Don't run the query yourself!
Only have whatever report/form that needs the parameters link to the
query.
Maybe explaining what I did will be more helpful; and don't despair, it
took
me a couple of days as well to change my way of thinking. This requires a
paradigm shift.
I started with a menu-form that had 2 combo boxes - one for first names,
and
one for last names, and their labels. Nothing else.
Then I built my query. In the field for the the first name I used the
Build... function [in Design View] for that. I navigated to my menu form
in
the first column, and then in the second column I simply picked one of
the
two combo boxes listed there. That was it.
I did that for both the fields I wanted to filter the database for. Of
course you can just adapt the SQL command and paste it directly into the
Critera section of the field you want to use as a parameter.
Then I made a report based on the query, and placed a command button for
it
on the same menu form as the combo boxes. I also created another form
that
uses the query - it pulls the information of the person I specify - and
also
placed a command button for that on the same form as the report button
and
the two combo boxes.
So now when the database is started, an autoexec macro launches the menu
form, and that's all the user sees. They see two combo boxes that prompt
them
to enter a first and a last name, so they do that, and then they can
either
look at that person's information, or get a report with all the records
associated with that person.
Hope that makes sense.
Rich D said:
Wayne,
I'm feel like such an illiterate. I created the form (titled "Job
Names /
Numbers", but I'm not sure what the Name of Combo is. Anyhow, I
entered the
criteria as best I could from what you an Niniel told me. When I run
the
query, the box comes up with the criteria without [] in the parameter
box...no drop down list. Put on your kindergarten teacher hat and get
back
to me please...and thanks.
--
Rich D
Armstrong Custom Homes
Redmond
:
Hi Rich
You could create a small popup form with just one field (a combobox).
Use
this form to provide the perameter that the quesry is asking for.
Set this in the criteria of the query column
[Forms]![NameOfPopUp]![NameOfCombo]
Hope this helps
--
Wayne
Manchester, England.
Not an expert
Enjoy whatever it is you do
:
I am creating a query and I want to tell it which job I want to
query. I
know how to create the query where it asks me and I have to key in
the exact
name. How can I have it give me a combo box so I can select the
job from a
list?