Form ops

Son268

Registered User.
Local time
Today, 23:16
Joined
Mar 31, 2001
Messages
20
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
 
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
 
Hi do I put that under the event procedure?
(ie the onclick) of the button

Thanks
 

Users who are viewing this thread

Back
Top Bottom