2 combo boxes 1 report

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
 
J

Joan Wild

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top