G
Guest
I have a functioning query, which is linked to a user-friendly dialog box,
which is supposed to show the filtered results in a separate form which I
have linked to another form. The query works by itself, the linked forms are
working great, the dialog box has all the info, but when I click the cmdOK
button, it just brings up the "Facilities" form with all the records,
unfiltered and not matching the search results. Here is the code for the
dialog box:
Option Compare Database
Private Sub Command14cmdOK_Click()
End Sub
Private Sub cmdOK_Click()
DoCmd.Requery
DoCmd.OpenForm "Facilities"
DoCmd.Close acForm, Me.Name
End Sub
And here is query SQL:
SELECT Facilities.[Facility Name], Facilities.[Nearest Major US City],
Facilities.[Nearest Major City], Facilities.[In-Field Recruiting],
Facilities.[Recruiting for Off-Site Sessions],
Facilities.[In-Home/Ethnographies Recruiting], Facilities.[National
Recruiting Database]
FROM Facilities
WHERE (((Facilities.[Facility Name])=Forms!Lookup!Facility) Or
((Facilities.[Nearest Major US City])=Forms!Lookup![Mjr US cty]) Or
((Facilities.[Nearest Major City])=Forms!Lookup![Mjr frgn cty]) Or
((Facilities.[In-Field Recruiting])=Forms!Lookup!infield) Or
((Facilities.[Recruiting for Off-Site Sessions])=Forms!Lookup!offsite) Or
((Facilities.[In-Home/Ethnographies Recruiting])=Forms!Lookup!inhome) Or
((Facilities.[National Recruiting Database])=Forms!Lookup![nat dtb]));
Please help if you know where my problem is, thank you so very much in
advance!
which is supposed to show the filtered results in a separate form which I
have linked to another form. The query works by itself, the linked forms are
working great, the dialog box has all the info, but when I click the cmdOK
button, it just brings up the "Facilities" form with all the records,
unfiltered and not matching the search results. Here is the code for the
dialog box:
Option Compare Database
Private Sub Command14cmdOK_Click()
End Sub
Private Sub cmdOK_Click()
DoCmd.Requery
DoCmd.OpenForm "Facilities"
DoCmd.Close acForm, Me.Name
End Sub
And here is query SQL:
SELECT Facilities.[Facility Name], Facilities.[Nearest Major US City],
Facilities.[Nearest Major City], Facilities.[In-Field Recruiting],
Facilities.[Recruiting for Off-Site Sessions],
Facilities.[In-Home/Ethnographies Recruiting], Facilities.[National
Recruiting Database]
FROM Facilities
WHERE (((Facilities.[Facility Name])=Forms!Lookup!Facility) Or
((Facilities.[Nearest Major US City])=Forms!Lookup![Mjr US cty]) Or
((Facilities.[Nearest Major City])=Forms!Lookup![Mjr frgn cty]) Or
((Facilities.[In-Field Recruiting])=Forms!Lookup!infield) Or
((Facilities.[Recruiting for Off-Site Sessions])=Forms!Lookup!offsite) Or
((Facilities.[In-Home/Ethnographies Recruiting])=Forms!Lookup!inhome) Or
((Facilities.[National Recruiting Database])=Forms!Lookup![nat dtb]));
Please help if you know where my problem is, thank you so very much in
advance!