How do I make form in MS Access query multiselections?

BigPete

New member
Local time
Today, 11:11
Joined
Jan 12, 2014
Messages
2
Hi guys. For a heads up I'm really new to Access and using Office 2007. Comfortable with SQL but have no idea about VBA.

How do I get the form to query multi-selections? For example if you download the attachment here and refer to "Form1", let's say the user multiselects BK and McD's for Vendor, burger for Food, and Coke for Beverage. It should be spitting out 3 records but instead spat out an empty table. I tied my last query "query2" with "Form1" to make them work hand-in-hand which filters the master table "Fast Food". Would I need to tweak the syntax seen in the "Criteria:" cells of "query2" to make them read in multiselections?
 

Attachments

First, your table structure is not normalized. Instead of a table per vendor with vendor name, beverage, food, price as the fields, I'd suggest a table for vendors with a primary key and vendor name fields and a table for items with the vendor's foreign key, item, and price.

Second, your query assumes that there will be values in all the form's criteria fields. What if someone wanted to see all BK menu items under $6.00, or check the price of a Coke at all available vendors? Use Iif statements in your query criteria to check for values and apply criteria if present, or use validation on your command button to ensure appropriate values are present in all required form fields.
 

Users who are viewing this thread

Back
Top Bottom