Using a form to enter report crtieria

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

Guest

I utilized the guidelines in "Micrsoft Office Assistance:Create a form to
enter report criteria" to create the macros, the form, and modify my report
and the underlying query. Everything seems to work fine independently;
however, when I open my report, and I enter the criteria, the form closes but
the report fails to open. Has anyone else used these guidelines and had the
same problem? If so, did you find a solution? Or does anyone have any ideas?
 
I utilized the guidelines in "Micrsoft Office Assistance:Create a form to
enter report criteria" to create the macros, the form, and modify my report
and the underlying query. Everything seems to work fine independently;
however, when I open my report, and I enter the criteria, the form closes but
the report fails to open. Has anyone else used these guidelines and had the
same problem? If so, did you find a solution? Or does anyone have any ideas?

The form is not supposed to close until the report is closed.
You can adapt the following method.
Create an unbound form.

Also add 2 unbound text controls.
Set their format to a valid date format.
Name them "StartDate" and "EndDate"

Add a Command Button to the form.
Code the button's click event:

Me.Visible = False

Name this form 'ParamForm'

As criteria in the query date field write:
Between forms!Paramform!StartDate and forms!ParamForm!EndDate

Next, code the report's Open event:
DoCmd.OpenForm "ParamForm", , , , , acDialog

Code the report's Close event:
DoCmd.Close acForm, "ParamForm"

When ready to run the report, open the report.
The form will open and wait for the entry of the starting and ending
dates wanted.
Click the command button and then report will run.
When the report closes, it will close the form.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top