2 combo boxes 1 report

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi,

I have a form with 2 combo boxes (A and B) used to pass searched information
from a query to a common report. ComboA searches for Customer_Name or ComboB
for licence plate#. For ComboA I've Command1 to trigger the report while I
use Command2 for ComboB (both combos use Customer_ID to pass on the info).

Well, I would like to use only one Comand button for either Combo box. So,
I'd
imagine I'd need an IIF statement which detects info in either combo box.
The common Command would be something like: IIF ComboA has data OR ComboB
has data, then open report.

Can someone please translate my thoughts into coding?

TIA

Mike
 
DoCmd.OpenReport "YourReport", acViewPreview, , "Customer_ID = " & Me!ComboA
& " Or Customer_ID = " & Me!ComboB

That assumes that Customer_ID is a number. You'd also have to ensure that
only one of the comboboxes is used (or maybe not, if you want to see two
customers)
 
Back
Top