48Highlander
Technical User
I have a select query as follows:
The control cboTypeSelect can have values from 1 to 6 plus *. The asterisk is added to the combo rowsource of frmReportSelector programatically and represents "all" of the types.
Whenever I select <all> types using the combobox, no records are selected. The query works fin if the value of the combobox is a value of 1 through 6. How can I get this query to return records for all types within the date range specified?
Code:
SELECT tblSponsorships.SponsorID, tblSponsorships.Amount, tblSponsorships.TypeCode, tblSponsorships.Date
FROM tblSponsorships
WHERE (((tblSponsorships.TypeCode)=[Forms]![frmReportSelector].[cboTypeSelect]) AND ((tblSponsorships.Date)>=[forms]![frmReportSelector].[txtStartDate] And (tblSponsorships.Date)<=[forms]![frmReportSelector].[txtEndDate]))
ORDER BY tblSponsorships.SponsorID;
The control cboTypeSelect can have values from 1 to 6 plus *. The asterisk is added to the combo rowsource of frmReportSelector programatically and represents "all" of the types.
Whenever I select <all> types using the combobox, no records are selected. The query works fin if the value of the combobox is a value of 1 through 6. How can I get this query to return records for all types within the date range specified?