Criteria Linking

C

Connie

I would like to use a macro to filter ID's from form to form. For example, I
am in John Smith's record in a main form and want to go to John Smith's
record in the payroll form. Any help appreciated.
 
S

Steve Schapel

Connie,

Go to a new macro in the macro design window, and enter OpenForm in the
Action column, and nominate the Payroll form in the Form Name argument.
Then, in the Where Condition argument box, enter the equivalent of...
[ID]=[Forms]![MainForm]![ID]
Of course, you would substitute the name of your actual ID field and
form name.
Then you can assign this macro on the applicable event property, most
likely the Click event of a command button onthe main form.

If you would prefer to use a VBA procedure instead of a macro, enter
code using this syntax ...
DoCmd.OpenForm "Payroll", , , "[ID]=" & Me.ID
 
Top