Macro to open form bases off of two requirements

ShawnH

Registered User.
Local time
Today, 12:48
Joined
Aug 26, 2011
Messages
11
Greetings,

I have an issue that I cannot figure out and was hoping someone here can help. I have a button on a sub form that I need to open another form where two fields equal on both. I have built the WHERE condition and it works fine if I only have one field to match [Course_ID] = [Course_ID], but I need two fields to match [Course_ID] & [Traveler_SSN] = [Course_ID] & [Traveler_SSN]. When I add the second requirement, the form comes back blank. I'm know that VBA is probably the preferred method of doing this but I know nothing about VBA :(

This is the current WHERE CLAUSE:

[qry_Traveler_TDYs]![Course_ID]=[Forms]![frm_Add_Edit_Course]![Assign Travelers]![Course_ID]


But this is what I need it to actually do:

[qry_Traveler_TDYs]![Course_ID] & [Traveler_SSN]=[Forms]![frm_Add_Edit_Course]![Assign Travelers]![Course_ID] & [Traveler_SSN]


Any help would be greatly appreciated!
 
Disregard, I figured it out. The clause should look like this

[qry_Traveler_TDYs]![Course_ID]=[Forms]![frm_Add_Edit_Course]![Assign Travelers]![Course_ID] AND [qry_Traveler_TDYs]![Traveler_SSN]=[Forms]![frm_Add_Edit_Course]![Assign Travelers]![Traveler_SSN]
 

Users who are viewing this thread

Back
Top Bottom