Select Query Parameter Repeating

G

Guest

I am using MS Access 97 and have a select query that contains a parameter.
This parameter asks for the users name. The user types in the name and based
on what they typed, the query will pull all the records containing that name
from the "Name" column in the table. To create this parameter in the "Name"
column, I typed in the critera "[Enter Your First Name:]". Also along with
this parameter there is another parameter that checks for "No" in a yes/no
data column. To create this parameter in the "Yes/No" column, I typed in the
criteria "No".

The "Name" select query is connected to a command button on my form. So
when the user clicks the "Name" command button on the form, the parameter
will ask for the users name.

The problem I am having is that after continuous use of clicking on the
command button, maybe 10 times a day for a month or so, the parameter appears
twice and the user has to enter their name twice. I only want the parameter
to ask for their name once.

I have recreated the query from scratch to make sure something goofy behind
the scenes wasn't happening, but I'm still getting the problem after
continued use. Does anyone have any ideas? Is it because I'm using Access
97? Or is there another way to create this select query based on that
parameter? I am willing to create a more complex select query with that
parameter granted I don't get this problem anymore. Please help. Thanks.

Ryan
 
N

Nikos Yannacopoulos

Ryan,

There's a much better solution that doesn't require a more complex query!
You say you are running the query through a command button on a form; well,
add an unbound text box on the form, and call it, say, txtFName. Then go to
your query design and change the [Enter Your First Name:] criterion to:

Forms![TheFormName]![txtFName]

so the query gets the criterion directly from the form; then the user types
in their firstname and clicks on the button (just remember to change
TheFormName to the actual form name). As a next step, you may want to use a
combo box instead, whose rowsource is set to unique first names form the
table, so the user need only select, not type. The rest is exactly the same.

HTH,
Nikos
 

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