NAMING

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hey everyone,
I am trying to create a query that asks for a persons name. I put the
question in brackets, however the name is not seperated by first and last
name tables.

Is there any way for the query to search by just the first name and produce
all those records or would I have to put the entire name as it was inputed
originally?

I hope that makes sense

Thanks
Ransom
 
First, you should separate your fields into two if possible in your table.
If not, at least try to separate them in your query.

One way is to create a new column in your query that pulls everything after
the comma (assuming your name is in the format of Last, First). If not,
pull everything up to the first space. Then put your criteria under that
column. If you want to make your query a bit more "loose" you could put
your criteria as:

Like "*" & [Enter First Name] & "*"
 
In the query you can use a wild card using Like to search the field and
display all the record that contain that string (Start , middle, end )

Any where in the string
Select * From TableName Where FieldName Like "*" & [Please enter name] & "*"

Just in the beginning of the string
Select * From TableName Where FieldName Like [Please enter name] & "*"

Just in the End of the string
Select * From TableName Where FieldName Like "*" & [Please enter name]

Note:
The criteria under the field will be

Like "*" & [Please enter name] & "*"
 
DUDE.....that was PERFECT thanks...it was driving me crazy!!

Ofer Cohen said:
In the query you can use a wild card using Like to search the field and
display all the record that contain that string (Start , middle, end )

Any where in the string
Select * From TableName Where FieldName Like "*" & [Please enter name] & "*"

Just in the beginning of the string
Select * From TableName Where FieldName Like [Please enter name] & "*"

Just in the End of the string
Select * From TableName Where FieldName Like "*" & [Please enter name]

Note:
The criteria under the field will be

Like "*" & [Please enter name] & "*"


--
Good Luck
BS"D


Ransom said:
Hey everyone,
I am trying to create a query that asks for a persons name. I put the
question in brackets, however the name is not seperated by first and last
name tables.

Is there any way for the query to search by just the first name and produce
all those records or would I have to put the entire name as it was inputed
originally?

I hope that makes sense

Thanks
Ransom
 
Ransom,

If you prompt for the first name only, the parameter criteria

Like [Enter First Name] & "*"

will find all people with that first name. You could also use a sorted
combo box with the AutoExpand property set to Yes. As you typed the first
name, the selection would go to the first match, afterwhich you could scroll
down and select them.

Hope that helps.
Sprinks
 

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

Back
Top