View Full Version : Problems passing parameters to a query from a form to generate a report


RHubbard
07-13-2006, 08:21 AM
I am attempting to use a custom dialogue form to pass parameters to a query when a report is opened. The dialogue form has a combo box on it that pulls employee names from a record source that is another query.

When I open the report, the dialogue form opens properly, and permits me to select a name from the cbo list. When I click the OK button to generate the report, Access’s standard ENTER PARAMETER VALUE form appears and the report will not run unless I type in the parameter (which clearly defeats the purpose if using the custom dialogue form in the first place).

This is the field criteria in the query:

[forms]![frmTestDialogue]![cboFindName]

I have confirmed (over and over) that the names of the form and of the cbo control are correct, but I still can’t seem to make things work correctly.

My sense is that the dialogue form is NOT passing the information back to the query but I am at a loss as to why. Any suggestions?

Thanks.

KeithG
07-13-2006, 08:35 AM
Are you closing the dialuge form before opening the report? Does the ENTER PARAMETER VALUE say [forms]![frmTestDialogue]![cboFindName]?

CraigDolphin
07-13-2006, 11:38 AM
If you haven't already, you might also try explicitly declaring the parameter in the Query>Parameters menu (from design view of the query your report is based on).

RHubbard
07-13-2006, 12:24 PM
Thanks for the suggestions.

As it turned out, I WAS actually closing the dialog before passing the parameters.

Gotta learn to pay attention, I guess.

Thanks again

Rick