Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

txt box as inut to query criteria

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
papa jonah - 21 Nov 2005 22:48 GMT
I have created a form with a text box (txtInput).  My hope is to be
able to enter a string to be used as criteria in a query.  For example,
I want to be able to enter *elect* into the text box and have the query
result in anything that has "electrical" or "electric" in it.  The way
that I have built the query inlcudes the following for the criteria.
[Forms]![query form]![txtInput]
It doesn't work.  If I substitute the above criteria with "*electr*" -
it works fine.

This is modeled after a similar structure that uses a combobox instead
of a text box which also works.

Any ideas?
fredg - 21 Nov 2005 23:04 GMT
> I have created a form with a text box (txtInput).  My hope is to be
> able to enter a string to be used as criteria in a query.  For example,
[quoted text clipped - 9 lines]
>
> Any ideas?

Is the criteria Field's datatype Text?
Change the query criteria to:
Like "*" &  [Forms]![query form]![txtInput] & "*"

Then just enter elect (not *elect*) in the text control.

The form must be open when the query is run.
Signature

Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.