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!

Using a combo box to change query criteria????

Status
Not open for further replies.

JwithaL

Technical User
Jul 14, 2004
44
I have a combo option group in a form and I want it to change what is in the criteria of a specific query.

IIf([Forms]![Sales History]![Sample_Frame]=1,([ICITEM].[SEGMENT1])<"9") ---- This is what I typed in the criteria field in the query

Background info: Sample_Frame is name of the option group... if the #1 checkbox is checked I want the query to run with the criteria filtering everything <9

It's probably something little, but it's buggin the hell out of me so any help would mean a lot.
 
Use [Forms]![Sales History]![Sample_Frame].Value

IIf([Forms]![Sales History]![Sample_Frame]=1,([ICITEM].[SEGMENT1])<"9")

By the way, you can assign the values for each button so if the first button is clicked, it will hve the value of 9, then just do a QBF.
 
where do i put the [Forms]![Sales History]![Sample_Frame].Value

Sorry a little confused
 
In your query criteria.

If you created a query, you would put [Forms]![Sales History]![Sample_Frame].Value where ever you put your criteria for the query.

Also, it is important to note that the form must be open for this to work with a query.
 
Okay I can do that, but how do I state that if that [Forms]![Sales History]![Sample_Frame].Value=1, only show the fields that are < "9".

Whenever I put the < "9" in there, no records show up and that is where I'm having my problem.

The column consists of numerical and text entries so I am trying to make a button to allow me to view all entries with or all entries without text fields. I have just found that having the <9 eliminates all the text fields.

Thanks for the help and sorry if this bit of info changes the approach... I probably should have said this earlier.
 
I'm sorry man I just found out what you were talking about with the changing of the value in the form... It works perfectly. Thanks a lot for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top