Form queries. Multiple checkboxes.

radink

Registered User.
Local time
Today, 14:13
Joined
Dec 21, 2006
Messages
18
Hey all,

Im a little stuck here.

I have a form Im using to run a query. The form has multiple text fields and check boxes. Everything works fine If I just select (any)one of the check boxes. If I check more than one, I get no results. (which is because no records have them both selected). So if I change them or OR in the SQL code, I can get them to work, but then they stop working individually.

My criteria for the checkbox is:
IIf([forms]![frmsearch]![hist]=True,True,False)

Changing "hist" to each appropriate field.

The SQL is as follows:

Code:
SELECT [tblProject Info].[GALE JN], [tblProject Info].[Project Name], [tblProject Info].[Client Name], [tblProject Info].[Project Description], [tblProject Info].[Date Started], [tblProject Info].Type1, [tblProject Info].Type2, [tblProject Info].Type3, [tblProject Info].[Total Project Fee], [tblProject Info].Status, [tblProject Info].[Proj Mngr], [tblProject Info].Historical, [tblProject Info].Architects
FROM [tblProject Info]
WHERE ((([tblProject Info].[GALE JN]) Like "*" & [Forms]![frmSearch]![jobnum] & "*") AND (([tblProject Info].[Client Name]) Like "*" & [Forms]![frmSearch]![client] & "*") AND (([tblProject Info].Type1) Like "*" & [Forms]![frmSearch]![types] & "*") AND (([tblProject Info].Historical)=IIf([forms]![frmsearch]![hist]=True,True,0)) AND (([tblProject Info].Architects)=IIf([forms]![frmsearch]![arch]=True,True,0)))
ORDER BY [tblProject Info].[GALE JN];

It's like i need it to do AND and OR. :)

Thanks for any help.
 

Users who are viewing this thread

Back
Top Bottom