how to filter one field with 2 combo boxs

sspreyer

Registered User.
Local time
Today, 05:01
Joined
Nov 18, 2013
Messages
251
hi ,
all

I have 2 unbound combo box's on a form 1 called cboclient1 and the another called cboclient2. would like to be able to filter field name client name twice by cboclient1 and cboclient2 here my sql from my query

Code:
WHERE (((Assets.Client)=Forms![report gen]!cboclient1)) Or (((Forms![report gen]!Cboclient1) Is Null));

this works perfectly for cboclient1 problem comes when I try and add cboclient2

I have tried

Code:
WHERE (((Assets.Client)=Forms![report gen]!cboclient1)) Or (((Forms![report gen]!Cboclient1) Is Null))AND(((Assets.Client)=Forms![report gen]!cboclient2)) Or (((Forms![report gen]!Cboclient2) Is Null));[/


this doesn't work at tall

any help much appreciated

cheers

shane
 
You've got a ton of parenthesis, too many for my taste, but when I broke them out and made them readable it turns out you don't have enough.

Code:
(
	(
		(Assets.Client)=Forms![report gen]!cboclient1
	)
)

Or
(	
	(
		(Forms![report gen]!Cboclient1) Is Null
	)
)
AND
(
	(
		(Assets.Client)=Forms![report gen]!cboclient2
	)
)
Or
(
	(
		(Forms![report gen]!Cboclient2) Is Null
	)
)

I suspect you wanted to group both Cboclient1 statements together, but that is not what you have done. You need one set of parenthesis around the 1st pair of statements and another around the second pair.
 
Last edited:
I suspect you wanted to group both Cboclient1 statements together, but that is not what you have done. You need one set of parenthesis around the 1st pair of statements and another around the second pair.


thanks plog for your help

I don't understand parenthesis around the 1st pair of statements and another around the second pair where? sorry I not great with access

cheers

shane
 

Users who are viewing this thread

Back
Top Bottom