Now I have two combos, cboPID_filter and cboVID_filter. The user can make a choice in only one of them. Each of those combos determine the contents of a second combo, cboVID_match and cboPID_match respectively. The ‘match’ combos have record source queries called qryVIDMatch and qryPIDMatch.
The question is, how can I specify a Where clause directly in the combo boxes instead of hard coding it in the queries? As I set it up yesterday, in the query iteself I defined a parameter and the PID field criteria as:
Code: Select all
[Forms]![frmServiceEventsFind]![cboPID_filter]
Code: Select all
PARAMETERS [Forms]![frmServiceEventsFind]![cboPID_filter] Text ( 255 );
SELECT DISTINCT qryServiceEvents.VolunteerID, qryServiceEvents.VID,
qryServiceEvents.FirstName_tblVolunteers, qryServiceEvents.LastName_tblVolunteers,
qryServiceEvents.PID
FROM qryServiceEvents
WHERE (((qryServiceEvents.PID)=[Forms]![frmServiceEventsFind]![cboPID_filter]));
I get it that I may be over-complicating the whole thing. I can certainly make all access to the report through the viewing form so it acts as a means to review the filtered data and then print it. When the report closes it returns to the form where they can apply another filter and print that.
But I’d like to know if it’s possible to pass a Where clause to a combo box record source.