Parameter query

  • Thread starter Thread starter Kam Nguyen
  • Start date Start date
K

Kam Nguyen

I am new to access and I want to create a parameter query
that returns all records that have a value that matches
the value entered by the user at run time. However, when
the database was created , the person that created the
database used only one field for the Name. When the data
was entered into the database, some people entered the
last name followed by the first name while others entered
the first name followed by the last name . What criteria
do I place in the criteria text box of the Name field to
return all records that have the name entered by the user
at run time regardless of how the data was entered?

Thank you
 
I am new to access and I want to create a parameter query
that returns all records that have a value that matches
the value entered by the user at run time. However, when
the database was created , the person that created the
database used only one field for the Name. When the data
was entered into the database, some people entered the
last name followed by the first name while others entered
the first name followed by the last name . What criteria
do I place in the criteria text box of the Name field to
return all records that have the name entered by the user
at run time regardless of how the data was entered?

Thank you

As criteria in the query:
Like "*" & [Enter Last Name] & "*"

The above will find all instances of, for instance, 'Smith' (if
'Smith' was entered), where ever in the field it is. Unfortunately it
will also find 'Smithfield' and 'Hammersmith'.

I would suggest you take the time now to fix the poor design and get
the first and last names into their own separate fields.
Also the name of the field should not be 'Name'.
Name is a reserved Access key word.
 
Back
Top