Simple Query Question

  • Thread starter Thread starter JHB
  • Start date Start date
J

JHB

Hi

In Access, I am attempting to create a query which, when activated,
will ask for the first "n" number of characters of a name and bring up
all names that contain the entered letters. However, I am having
trouble setting it up.

I am using the Access query template for the appropriate data table,
and in the line named Query, for the field I wish to interrogate I
have entered:

(Enter part of last name: ]&"*")

The intent is to have the user enter the first few letters of the last
name, and then have the query add the * to make it wild car search
after that. It does not work, and I am certain its due to the syntax..
The prose appears as it should, but even when you type in he full name
of someone on the database it does not do the selection. It comes up
empty.

Can someone tell me what syntax I should use.

I have used Access before, and have even done this before, but I cant
recall the details and its been years since I dabbled in it. I find
that its not quite like riding a bicycle - you don't recall
everything!



Thanks in Advance

John Baker
 
Hi John,

You were close! Try this form instead, as the criteria entry for the Last
Name field:

Like [Enter part of last name: ] & "*"

When you use the wildcard character, you need to use the "Like" keyword.

Tom Wickerath
Microsoft Access MVPhttps://mvp.support.microsoft.com/profile/Tomhttp://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

JHB said:
In Access, I am attempting to create a query which, when activated,
will ask for the first "n" number of characters of a name and bring up
all names that contain the entered letters. However, I am having
trouble setting it up.
I am using the Access query template for the appropriate data table,
and in the line named Query, for the field I wish to interrogate I
have entered:
(Enter part of last name: ]&"*")
The intent is to have the user enter the first few letters of the last
name, and then have the query add the * to make it wild car search
after that. It does not work, and I am certain its due to the syntax..
The prose appears as it should, but even when you type in he full name
of someone on the database it does not do the selection. It comes up
empty.
Can someone tell me what syntax I should use.
I have used Access before, and have even done this before, but I cant
recall the details and its been years since I dabbled in it. I find
that its not quite like riding a bicycle - you don't recall
everything!
Thanks in Advance
John Baker

Thank you all very much. I knew it was simple, but just had not
recalled "Like".!


John Baker
 

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

Similar Threads


Back
Top