selecting an item from 2 list boxes

G

Guest

Hi
In my form I want to be able to select 1 item from 1 list box and another
item from another list box to give me a report based on the selections. It
works if I chose something from 1 list box but I'm not sure of the syntax to
combine the two strWhereCategory's. Below are the strWhereCategory's
separately.

strWhereCategory = "SupplierID = Forms![Product Enquiries By
Supplier]!SupplierList"

strWhereCategory1 = "ProductID = Forms![Product Enquiries By
Supplier]!ProductList"

In my switch statement I have the following code which opens a report based
on the selection from the first list box:
Case 3
DoCmd.OpenReport "List of Products By Supplier and Job",
acPreview, , strWhereCategory

Does anyone know how to combine these so that the report is based on
selections from both list boxes?
Regards
Sean
 
J

John Spencer (MVP)

I would try inserting an " OR " between the two strings.

Case 3
DoCmd.OpenReport "List of Products By Supplier and Job",
acPreview, , StrWhereCategory & " OR " & strWhereCategory1
 

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