elevins
Technical User
- Jan 24, 2005
- 18
In a Dynamic Query I am using a button to run an event procedure. I have 3 check boxs that I would like to search and display 'if' the check box is selected. There will also be 9 text boxes and I would like to enter criteria and check box and have the query display a table with the correct criteria. I have the text boxes working and the check boxes will work If I only make one active.
Is there a way I can use multiple check boxes without the query saving the value of each check box field as 'True' or 'False'and still have it display correctly?
sample code:
where = Null
where = where & " AND [Inventory]like '" + Me![Inventory] + "*'"
where = where & " AND [SerialNum]like '" + Me![SerialNum] + "*'"
where = where & " AND [Description]like '" + Me![Description] + "*'"
where = where & " AND [Mfg]like '" + Me![Mfg] + "'"
where = where & " AND [ModelNum]like '" + Me![ModelNum] + "*'"
where = where & " AND [Cost]like '" + Me![Cost] + "'"
where = where & " AND [CaseNum]like '" + Me![CaseNum] + "*'"
where = where & " AND [Remarks]like '" + Me![Remarks] + "*'"
where = where & " AND [Date]like '" + Me![Date] + "*'"
where = where & " AND [Junk]=" & IIf(Me![Junk], "True", "False")
where = where & " AND [Stored]=" & IIf(Me![Stored], "True", "False")
where = where & " AND [Stolen]=" & IIf(Me![Stolen], "True", "False")
Is there a way I can use multiple check boxes without the query saving the value of each check box field as 'True' or 'False'and still have it display correctly?
sample code:
where = Null
where = where & " AND [Inventory]like '" + Me![Inventory] + "*'"
where = where & " AND [SerialNum]like '" + Me![SerialNum] + "*'"
where = where & " AND [Description]like '" + Me![Description] + "*'"
where = where & " AND [Mfg]like '" + Me![Mfg] + "'"
where = where & " AND [ModelNum]like '" + Me![ModelNum] + "*'"
where = where & " AND [Cost]like '" + Me![Cost] + "'"
where = where & " AND [CaseNum]like '" + Me![CaseNum] + "*'"
where = where & " AND [Remarks]like '" + Me![Remarks] + "*'"
where = where & " AND [Date]like '" + Me![Date] + "*'"
where = where & " AND [Junk]=" & IIf(Me![Junk], "True", "False")
where = where & " AND [Stored]=" & IIf(Me![Stored], "True", "False")
where = where & " AND [Stolen]=" & IIf(Me![Stolen], "True", "False")