Newbie Query Question

  • Thread starter Thread starter Bob Guidice
  • Start date Start date
B

Bob Guidice

I've designed a database, and have begun working with parameter queries.
For the most part, I can accomplish everything I need with them relative to
queries, however....

Is there a way to populate a parameter query with a drop down list of
choices from a table, so that the user doesn't have to type in a "Class ID",
but can choose from a list of previously entered "Class ID's"?

If this can't be done through a parameter query, is there another way to do
this? The database is being designed for new users, so I'm trying to make
running reports as foolproof as possible.

Thanks in advance for the help.

Bob Guidice
 
Use a form to let the user type in the info (or, in your case, select an
entry from a combobox). Put a button on the form that will run the query
(VBA code or macro to do an OpenQuery action). Then use a criterion
expression similar to this in the query:
[Forms]![FormName]![ControlName]
 
Thanks for the help, but I forgot one important point.

My database is being designed for the inexperienced user. Is there any way
to tie the run form that runs the query to a report, so that from a button,
the user can simply run the report, have the form open for selection of the
"class id" from the combo box, run the query, print a report from the query,
and close back to the switchboard where the original run report button
resides?

I imagine most of this can be done in VBA, especially if the order is chosen
correctly and is well-planned, but I'm just wondering if there is a better
way. (Additionally, my VBA skills are somewhat limited in Access)

Thanks again for your help. I was actually able to make the original
form!!!

Bob Guidice
Ken Snell said:
Use a form to let the user type in the info (or, in your case, select an
entry from a combobox). Put a button on the form that will run the query
(VBA code or macro to do an OpenQuery action). Then use a criterion
expression similar to this in the query:
[Forms]![FormName]![ControlName]

--
Ken Snell
<MS ACCESS MVP>

Bob Guidice said:
I've designed a database, and have begun working with parameter queries.
For the most part, I can accomplish everything I need with them relative to
queries, however....

Is there a way to populate a parameter query with a drop down list of
choices from a table, so that the user doesn't have to type in a "Class ID",
but can choose from a list of previously entered "Class ID's"?

If this can't be done through a parameter query, is there another way to do
this? The database is being designed for new users, so I'm trying to make
running reports as foolproof as possible.

Thanks in advance for the help.

Bob Guidice
 
Oh yes.

It'll require you to use code in both the starting form and the "class id"
selection form.

Create your class ID selection form (call it frmClassIDSelect). Put the
necessary control on it to allow the selection of the class id and put a
command button (name it cmdOK) on it too. Put this code on the OnClick event
of the cmdOK button:

Private Sub cmdOK_Click()
Me.Visible = False
End Sub

On your first form, put a command button to run the report (name the button
cmdReport). On the OnClick event for this button, put this code (note that
you will need to replace some generic names with the real names):

Private Sub cmdReport_Click()
Const strForm As String = "frmClassIDSelect"
Const strReport As String = "NameOfReport"
DoCmd.OpenForm strForm, , , , , acDialog
DoCmd.OpenReport strReport
DoCmd.Close acForm, strForm
End Sub



--
Ken Snell
<MS ACCESS MVP>

Bob Guidice said:
Thanks for the help, but I forgot one important point.

My database is being designed for the inexperienced user. Is there any way
to tie the run form that runs the query to a report, so that from a button,
the user can simply run the report, have the form open for selection of the
"class id" from the combo box, run the query, print a report from the query,
and close back to the switchboard where the original run report button
resides?

I imagine most of this can be done in VBA, especially if the order is chosen
correctly and is well-planned, but I'm just wondering if there is a better
way. (Additionally, my VBA skills are somewhat limited in Access)

Thanks again for your help. I was actually able to make the original
form!!!

Bob Guidice
Ken Snell said:
Use a form to let the user type in the info (or, in your case, select an
entry from a combobox). Put a button on the form that will run the query
(VBA code or macro to do an OpenQuery action). Then use a criterion
expression similar to this in the query:
[Forms]![FormName]![ControlName]

--
Ken Snell
<MS ACCESS MVP>

Bob Guidice said:
I've designed a database, and have begun working with parameter queries.
For the most part, I can accomplish everything I need with them
relative
to
queries, however....

Is there a way to populate a parameter query with a drop down list of
choices from a table, so that the user doesn't have to type in a
"Class
ID",
but can choose from a list of previously entered "Class ID's"?

If this can't be done through a parameter query, is there another way
to
do
this? The database is being designed for new users, so I'm trying to make
running reports as foolproof as possible.

Thanks in advance for the help.

Bob Guidice
 
Back
Top