I have a combobox on a form which is used to build report criteria. The user selects a customer from the combobox, enters a begin/end date then a report is opened based on those values. The report is based off a query and shows only the customer selected in the combobox. I've recently been asked to include a report for all customers. Instead of making a new form, I added an "(All)" option to the combobox as follows:
I've also built a separate report which includes all customers. I'm trying to use an IF statement which would open the report for all customers if "(All)" is selected in the combobox. However, Access now crashes when trying to execute the IF statement for the combobox if "(All)" is selected. My statement is as follows:
- Using a msgbox prompt, I am able to validate "(All)" is returned when selected in the combobox
- Both reports work properly outside of the IF statement
SELECT tblAirlines.AirlineID, tblAirlines.AirlineCompany FROM tblFuelProviders INNER JOIN tblAirlines ON tblFuelProviders.ProviderID = tblAirlines.ProviderNameLookup WHERE (((tblAirlines.AirlineStatus)="Active")) ORDER BY tblAirlines.AirlineCompany UNION SELECT "(All)","(All)" FROM tblFuelProviders
ORDER BY tblAirlines.AirlineCompany;
I've also built a separate report which includes all customers. I'm trying to use an IF statement which would open the report for all customers if "(All)" is selected in the combobox. However, Access now crashes when trying to execute the IF statement for the combobox if "(All)" is selected. My statement is as follows:
If Me.cboAirlineCompany.Value = "(All)" Then
strReport = "rptTransactionsAll"
Else
strReport = "rptTransactions"
End If
- Using a msgbox prompt, I am able to validate "(All)" is returned when selected in the combobox
- Both reports work properly outside of the IF statement