I have a microsoft access 2003 database with a table that contains information about rooms in a building. One column is called NAME and there could be lots of rooms with the same name (like CLASSROOM). On a form I have a combo box that is a pulldown of all the existing room names
SELECT rooms.name
FROM rooms
GROUP BY rooms.name
ORDER BY rooms.name;
Then a button to preview a report that lists all the rooms with the name selected by the user. Here’s the query
SELECT rooms.number, rooms.name, rooms.floor
FROM rooms
WHERE (((rooms.name)=[forms]![roomquery].[combo1]))
ORDER BY rooms.number;
and that works great. What i need to figure out is how to make it list ALL of the rooms if the user doesn’t select anything.
I figured out a way to do this with VB code on the preview button, but i would end up with a horribly complex if-then-else if i use this method on my final product since there will probably be about 20 different combo boxes for various criteria that the user might only pick a few of for their report. any suggestions would be greatly appreciated!