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

Query linked to textbox on form

Status
Not open for further replies.

Moss100

Technical User
Aug 10, 2004
586
GB
Hello I have a query which gets one of its parameters from a text box on the form.

The query looks for the value in textbox100 on the form (out of interest this lets the user type a surname into text100, click a button and the query runs fine.

To be clear, if the textbox contains Smith, then the query returns the values with Smith as expected.

I would like the user also to be able to type in <>"Smith".

When textbox100 contains <>"Smith" the query fails. This seems odd because typeing <>"Smith" directly into the query runs fine.

Is there a simple way around this?

I have tried the textbox100 values as <>"smith <>Smith "<>Smith" - all without success

Many thanks Mark
 
Could you show us "the query" ?
And where your query expects "Smith".


Have fun.

---- Andy
 
Your parameter can't contain the operators like "= <> >= <= LIKE BETWEEN ..." You need to find another solution which might involve code to update the SQL of the query.

Duane
Hook'D on Access
MS Access MVP
 
I feared there may be no easy solution - thanks anyway :)
 
Thanks all - i found this on the web and it has solved my problem....


Like nz([Forms]![Main_view]![text100],"*")

Hope it will help others :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top