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

Customising the search record tool

Status
Not open for further replies.

arobbo

IS-IT--Management
Feb 15, 2005
62
GB
hi i'm trying to find any easy way to customise the search button you can add to a form. Basically i would like to always default to search in one field and always search any part of the field.

Anyone got any ideas of an easy way to do it i don't want to rewrite the search function in VB really....

Cheers

Andy
 
To search any part of the field use wildcards.

i.e.

SELECT *
FROM MyTable
WHERE DefaultField Like "*" & [Forms]![MySearchForm]![MySearchTextbox];

Stewart J. McAbney | Talk History
 
Sorry, pressed Submit too early...

SELECT *
FROM MyTable
WHERE DefaultField Like "*" & [Forms]![MySearchForm]![MySearchTextbox] & "*";

Stewart J. McAbney | Talk History
 
i didn't really want to use a query...

i could be wrong on this but if you use a query to search for data etc it won't let you modify the data that is displayed. I've been using the built in search for a record button which is basically the same as CTRL and F key , do you know of any way of altering that so function so it defaults to a field and the option search any part of ......

thanks for your reply though
 
i could be wrong on this"

You most certainly are.

You can also use the form's Filter property.

i.e.

Me.Filter = "[DefaultField] = """ & Me.txtMyTextBox & """"
Me.FilterOn = True



Stewart J. McAbney | Talk History
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top