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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FILTER QUERY DEPENDING OF FORM FIELD CONTENT

Status
Not open for further replies.

tabbytab

Technical User
Mar 21, 2005
74
0
0
GB
I'm sure what I want to do is very easy but evades me!


Very simple form with one field text box named selectioncriteria.

One bound query to the form field slectioncriteria.

If I enter >1 in the text box and then run the query I want it to retrieve records where the bound field is greater than one.

I cannot get it to work!!

I would laso like to be able to use Like '5*' etc in the text box on the form to filter query results.

Any help may stop the grey hairs going whiter

Thanks in advance
TabbyTab :)
 
Something very similar to this should work:

For the criteria part of that field in the query, type:

[forms]![frmName]![selectioncriteria]

..just replace frmName with the name of your form. This won't cover the "like" that you want to do but will give you exact matches. I'll try to get back to you on the "like".
 
You should have an ubound textbox !
In the AfterUpdate event of this textbox:
Me.Filter = "[selectioncriteria] " & Me![ubound textbox]
Me.FilterOn = True

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Sorry, my answer won't work as I didn't notice the ">" sign.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top