View Full Version : Form ops


Son268
10-09-2001, 05:59 AM
Hi again.

I have an unbound text box on a form whereby the user can enter a word that they are looking for and a command button that will then open the corresponding form. At the moment it will search and return only for the exact match. is there any way that i can amend the code that it will return results when the user only types in 'b' for 'black rock' instead of the having to type in 'black rock'.

thanks in advance

shacket
10-09-2001, 06:26 AM
Use a wildcard (*) in your code. Your SQL statement should look something like this:

"SELECT * FROM tblYourTable WHERE [YourFieldName] LIKE " & [YourTextFieldCriteria] & "*"

Entering a 'B' would then get you every record that begins with a B. You can place the * anywhere in the criteria.

HTH

Son268
10-09-2001, 07:25 AM
Hi do I put that under the event procedure?
(ie the onclick) of the button

Thanks

shacket
10-10-2001, 04:47 AM
Yep.