My passing from form criteria is not working

dosia

Registered User.
Local time
Today, 11:13
Joined
Jan 29, 2014
Messages
15
This is my passing criteria to query field:

IIf([Forms]![FrmUserSelection]![PricingType]=3,1 Or 2,[Forms]![FrmUserSelection]![PricingType])

My field is Pricing Type and holds records 1 or 2

I would like to pass value from my group option from a form.

It works fine if group option has a value 1 or 2 but it displays no records if option value is 3 What is wrong with my code.

Thanks
 
This bit is wrong
IIf([Forms]![FrmUserSelection]![PricingType]=3,1 Or 2,[Forms]![FrmUserSelection]![PricingType])
Is option 3 supposed to a 'all'

If so then then try changing your criteria from

WHERE myfield=IIf([Forms]![FrmUserSelection]![PricingType]=3,1 Or 2,[Forms]![FrmUserSelection]![PricingType])
to
WHERE myfield =[Forms]![FrmUserSelection]![PricingType] or [Forms]![FrmUserSelection]![PricingType]=3
 
if user selects option 3 i need to pass 1 and 2
if user selects option 2 i pass option value
if user selects option 1 i pass option value

My field where i pass the criteria only has value 1 and 2 so if user select option 3 i had to change it to 1 and 2 (all) If i don't change the 3 query has 0 records.
 
Dosia
You thanked CJLondon for his post and then posted indicating that it didn't work, it should work so maybe you need to clarify and paste in your SQL code.

Brian
 

Users who are viewing this thread

Back
Top Bottom