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!

using the acCmdFind

Status
Not open for further replies.

techkenny1

Technical User
Jan 23, 2009
182
0
0
AU
Hi all,
On text boxes I use the following code on a on click event to do a search
DoCmd.RunCommand acCmdFind

However at times the following error comes up.
"You can'tuse Find or Replace now"
*The fields are not searchable due to one of the following
*The fields are controls
*The fields have no data
*There are no fields to search
The only way to do a search is to close the search form down and then reopen it.
Is the code I use right or is there another way of doing a search.

Many thanks

 
There are many way to search, if you do a search on here you will find them.

But to get you in the mood, create a query with search criteria below, on the field you wish to search.

like "*" & [nameofsearchtextbox] & "*"

Use it as the record source of a form.

create a new search form with a textbox (which in this case I called nameofsearchtextbox) and either open the search result for you previously created with the afterupdate event of the textbox or use a button to open the results form.

Hope that helps.


Ian Mayor (UK)
Program Error
9 times out of 10 I know what I'm talking about. This must be my tenth reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top