How to code a "Like" query on a form

P

Parvaiz

Hi, can someone please help.
I want to create a form with 2 controls. A text box control for user input
and a GO button for when they have made their entry.
Lets say their choice is "Jones". I want that value to run a select query in
the form of ......Like "jones*" i.e

WHERE (((tblCRB_Master.[Surname / Forenames]) Like "Jones*"));

Please help as I need this asap for my new job. Thank you.
 
J

Jeff Boyce

Create a query in design view.

Add the table and fields you are looking for, including the selection
criterion field.

In the selection criterion of your field, put something like (untested):

Like Forms!YourFormName!YourTextBoxControlName & "*"

In your form, have your <Go> button run that query.

Good luck!

--

Regards

Jeff Boyce
Microsoft Access MVP

Disclaimer: This author may have received products and services mentioned in
this post. Mention and/or description of a product or service herein does
not constitute endorsement thereof.

Any code or pseudocode included in this post is offered "as is", with no
guarantee as to suitability.

You can thank the FTC of the USA for making this disclaimer
possible/necessary.
 

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