Open form at the time of opening report

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to open a form at the event of open report. The form has a combo box
and I want to select a value from that box and pass it as a criteria for the
report. query for the report is ready. Please suggest the changes on the
report side as well as on the form side.
 
knavlekar,
You wouldn't do that all in one step... it would take two.

Create a button to Open the form.
Enter the value form the combo.
On that form create a button that opens the Report. (leave the form open)

Lets say the form is called frmMyReport, and the combo is called cboMyValue (ex. a
State name value)
In the query behind the report, in the State field, place this criteria...
= Forms!frmMyReport!cboMyValue
That will filter the results of the report by the value you selected on the form.
 
Hi Campangna,
Thanks for the suggestion.

I want to pop up an form at the open event of the report. from that form I
want to pass criteria for the report query (using combo box and command
button).

the key thing is that I want to pop up an form once I click to open a report
(I do not want to open the form deliberately first and pass the value using
command button but I want the form as a pop up when I open the report.)

I think the question is clear now.

thanks in advance.
 
knavlekar,
The OnOpen event of the report is too late to open a separate form for a report
criteria.
The form, with it's criteria must be open prior to "calling" the report.

Or... forget the "pop-up form" altogether, and use a parameter in the report query to
request a criteria value from the user. When the report is run, the user will see an
InputBox (just like a pop-up form) requesting the criteria. User enters the criteria and
the report continues to open... with that criteria value.
 
Back
Top