Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need answer fast. Need Query with 3 conditions 1

Status
Not open for further replies.

HockeyFan

MIS
Jun 21, 2005
138
US
I have a form with a combo box field called 'status' and the choices are either 'open', 'closed', or 'all'.

I have created a query that in the status field, looks at the choice the user has selected from the combo box on a form. something like, [forms]![myform]![status].

anyhow, the problem is that the actual data in the field 'status' is either 'open' or 'closed'. I don't know how to get the query to display all the records when the user chooses 'all' from the combo box.
 
=[forms]![myform]![status] OR [forms]![myform]![status]='all'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks phv!

It worked great. however if you have 1 sec, can you tell me how this works? What i mean is, i understand what is going on as far as using the form's combo box to put that value in my status field, but how does the second part of your 'or' work?
normally if you chose 'open' or 'closed' it displays all the recs with that value in the status field. how does it know to display all the records when the user selects 'all'?

I would think that it would try to display only records with the word 'all' in the status field, similar to when the user chooses open or closed.
 
Go to the SQL view panel of your query and read the WHERE close.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top