Access VBA Macro Programming

(Joao Candeias) #1
Place your cursor anywhere on the join line, right-click, and then select Join Properties. A
window like that in Figure 12-3 will appear.
This provides options in which you can make a straight join (where the joined fields are
equal) or a left or right join where all the records are retrieved from one of the tables (but
only the records from the other table where the joined fields are equal). In this particular
case, where a right join has been made all orders will be shown, matching to customers
where possible.
For the query to work, you need to add some fields into the results section of the window.
You can either double-click the field name or drag it down to the Field row of the results
area. You can also use the drop-downs for Field and Table in the results area.
Add in the fields Company, Order Date, and Ship Name in this way. You can also enter
criteria in the Criteria row. For example, under Order Date, enter>#01/01/2006#. Your Query
Design window should now look like Figure 12-4.
Notice that your date criterion has a hash sign (#) at the start and end to designate it as a
date. It is entered according to the locale that Windows is set to, so in North America you
would use the mm/dd/yyyy format, otherwise the dd/mm/yyyy format.

152 Microsoft Access 2010 VBA Macro Programming


Figure 12-3 The Join Properties window in the Query Design window
Free download pdf