unspecific result for search

G

Guest

Hi,

Please tell me how can I format a textbox where I want all the similar
record when I type a keyword. For example, I type Smith, all with the word
smith in a surname will come out like Smithen or Blacksmith. The situation of
the form is like this:

A textfield to enter the keyword, option button to select whether surname or
company, and the command button to open which form. I put criteria in the
query [forms]![formname]![formTextfield].[Value], how can I add * as in sql
of LIKE *smith*** if I use textfield value? What is the solution?

Thanks,

rb
 
A

Allen Browne

Add wild cards in the criteria of your query, e.g.:
Like "*" & [forms]![formname]![formTextfield] & "*"

Actually, you might like this:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html
You don't need to write any code to achieve this.
Just copy'n'paste, and set one property to get this to work on any form.
 
G

Guest

Thanks a lot, that's a big help.

Allen Browne said:
Add wild cards in the criteria of your query, e.g.:
Like "*" & [forms]![formname]![formTextfield] & "*"

Actually, you might like this:
Find as you type - Filter forms with each keystroke
at:
http://allenbrowne.com/AppFindAsUType.html
You don't need to write any code to achieve this.
Just copy'n'paste, and set one property to get this to work on any form.

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

rb said:
Please tell me how can I format a textbox where I want all the similar
record when I type a keyword. For example, I type Smith, all with the word
smith in a surname will come out like Smithen or Blacksmith. The situation
of
the form is like this:

A textfield to enter the keyword, option button to select whether surname
or
company, and the command button to open which form. I put criteria in the
query [forms]![formname]![formTextfield].[Value], how can I add * as in
sql
of LIKE *smith*** if I use textfield value? What is the solution?

Thanks,

rb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top