Using Checkboxs in query

AVNerd

New member
Local time
Today, 14:57
Joined
Dec 12, 2011
Messages
2
I'm using MS Access to create a db for events and scheduling of my staff. I want to use a parameter form to run a query showing what 1 (or more) employees are assigned to during a given time period. I've got the date function of the parameter form working flawlessly, but I cannot figure out how to select employees and make the query work properly. If I have the following in the criteria of every employee checkbox, I get no results.

Like IIf([Forms]![frm_TechTest]![Lowder]=False,"*",[Forms]![frm_TechTest]![Lowder])

If I have this criteria in only 1 checkbox field, it works for that employee.

From 8-12 hours scanning the web, I think I need to have some extensive VB coding in each field allowing the criteria to act as an "OR" instead of an "AND", but not sure. Thoughts?
 
Last edited:
Without seeing your database I can only guess. Sounds like it is in fact treating it as AND and thus no results appear. I'm not sure how you want this to look aesthetically, but if you are only selecting one employee at a time, you should just use a combo box to select the employee of interest. This would eliminate the cluttered appearance of a bunch of check boxes.
 
Aesthetics aren't a big deal, but I'm not sure how to select multiple employees from the combo. There may be between 1-5 folks assigned to an event, based on the complexity and customer needs.
 
If you want to filter the query using multiple selections you will need to:

1. Use a listbox
2. Build the SQL statement in code based on the selected values

Search the forum for "Search form".
 

Users who are viewing this thread

Back
Top Bottom