Paramter Query / Dialog Box

  • Thread starter Thread starter Tony Renauldo
  • Start date Start date
T

Tony Renauldo

Access help has material on the subject "Create a paramter
query." One of the subtopics is "Create a custom dialog
box to prompt for your parameter query's criteria."

I believe I understand the concept of a paramter query,
and I've managed to create a form with combo boxes to
prompt the user to select data elements pulled from tables
in the database. What I can't do is make the query look at
the values in the form's controls that the ueser selects
and perform its query based on those values. I have
wracked my brain with macros and Visual Basic and
everything else and can't make it work.

If ANYONE has some suggestions, I would be most
appreciative. Thank you.

-Tony
 
Rachel,

Thank you, and I did that, but I'm still not having
complete success. What I'm not able to do is, once the
user enters the control values on the dialog box (from the
combo boxes), to get the dialog box to close and the query
to run and display its results in a different form.

-Tony
-----Original Message-----
In the criteria section of the field in your query you
need to reference the forms control;

[forms]![yourformname]![yourcontrolname]
-----Original Message-----
Access help has material on the subject "Create a paramter
query." One of the subtopics is "Create a custom dialog
box to prompt for your parameter query's criteria."

I believe I understand the concept of a paramter query,
and I've managed to create a form with combo boxes to
prompt the user to select data elements pulled from tables
in the database. What I can't do is make the query look at
the values in the form's controls that the ueser selects
and perform its query based on those values. I have
wracked my brain with macros and Visual Basic and
everything else and can't make it work.

If ANYONE has some suggestions, I would be most
appreciative. Thank you.

-Tony
.
.
 
As well as setting the criteria as per Rachel's suggestion you will also
need to have a command button on the form. Once the user has entered the
criteria in the comboboxes and hits the command button you need some code in
the click event of the button.
This code will open up your second form that has the paramater query as its
datasource - once this form is open you will be free to close the first form

something like:
sub fdf()
docmd.openform "form2"
docmd.close acform, "form1"
end sub

Hope this helps

A
Tony Renauldo said:
Rachel,

Thank you, and I did that, but I'm still not having
complete success. What I'm not able to do is, once the
user enters the control values on the dialog box (from the
combo boxes), to get the dialog box to close and the query
to run and display its results in a different form.

-Tony
-----Original Message-----
In the criteria section of the field in your query you
need to reference the forms control;

[forms]![yourformname]![yourcontrolname]
-----Original Message-----
Access help has material on the subject "Create a paramter
query." One of the subtopics is "Create a custom dialog
box to prompt for your parameter query's criteria."

I believe I understand the concept of a paramter query,
and I've managed to create a form with combo boxes to
prompt the user to select data elements pulled from tables
in the database. What I can't do is make the query look at
the values in the form's controls that the ueser selects
and perform its query based on those values. I have
wracked my brain with macros and Visual Basic and
everything else and can't make it work.

If ANYONE has some suggestions, I would be most
appreciative. Thank you.

-Tony
.
.
 
Back
Top