Using Queries to filter a form

S

sonfitz

I am somewhat new to Access and I do not know VBA but I wanted to try to use
a query to filter a form. The field I want to use as the filter contains
peoples names and I would like to have a pop-up box apper and not require the
user to input the full name of the person. If they were to only type part of
the name I would like that to be enough.

Example would be like this: Instead of haveing to type in a pop-up box the
full name "Karen Reinitz" I would like it if all they had to do is type in
"Karen" similar to using a "*" character. How can that be done. In other
words can the "*" character be automatically placed at the end of how ever
many characters a user types in the pop-up box?

Thanks
 
J

John Spencer

It sounds as if you have a parameter in your query. Something like the
following

Field: FullName
Table: Whatever
Criteria: [Enter Name]

If that is correct, then change Criteria to
Criteria: Like [Enter Name] & "*"

This will automatically find matches that start with whatever is entered in
the response.
 
K

KARL DEWEY

I would use several things different.

I would have the last name and first name in separate fields in the table.
Another for middle initial and still another for suffix like SR, JR, II, III,
etc.

Next I would use a ComboBox instead of popup with AutoExpand property set to
Yes. Use the LName field as Row Source or you can concatenate the parts of
the name together.
Like --
[LName] & ", " & [fname] & IIf([mi] Is Null,Null," " & [mi]) & IIf([suffix]
Is Null,Null," " & [suffix])
 
S

sonfitz

Thank you John, that worked perfectly!!

John Spencer said:
It sounds as if you have a parameter in your query. Something like the
following

Field: FullName
Table: Whatever
Criteria: [Enter Name]

If that is correct, then change Criteria to
Criteria: Like [Enter Name] & "*"

This will automatically find matches that start with whatever is entered in
the response.


sonfitz said:
I am somewhat new to Access and I do not know VBA but I wanted to try to
use
a query to filter a form. The field I want to use as the filter contains
peoples names and I would like to have a pop-up box apper and not require
the
user to input the full name of the person. If they were to only type part
of
the name I would like that to be enough.

Example would be like this: Instead of haveing to type in a pop-up box the
full name "Karen Reinitz" I would like it if all they had to do is type in
"Karen" similar to using a "*" character. How can that be done. In other
words can the "*" character be automatically placed at the end of how ever
many characters a user types in the pop-up box?

Thanks
 
Top