Open then minimize a form before a report opens

  • Thread starter Thread starter Tom Brown
  • Start date Start date
T

Tom Brown

I have a "Deposit Detail" report which pulls data from the "Deposit detail"
table based on the
Settlement date which is entered in a "Choose Settlement date for report"
form.
I want to have Access work it so when I open the "Deposit Detail" report,
the "Choose Settlement date
for report" form opens before the report, allows the user to enter the date
they want for the report,
minimizes the Choose Settlement date form, then opens the Deposit Detail
report, which will
then detail all Deposit Details for the Settlement date chosen. I tried
this by creating macros, and I could
always get the form to open first, but I couldn't get the form to minimize.
Any help will be appreciated.

Thanks
 
I have a "Deposit Detail" report which pulls data from the "Deposit detail"
table based on the
Settlement date which is entered in a "Choose Settlement date for report"
form.
I want to have Access work it so when I open the "Deposit Detail" report,
the "Choose Settlement date
for report" form opens before the report, allows the user to enter the date
they want for the report,
minimizes the Choose Settlement date form, then opens the Deposit Detail
report, which will
then detail all Deposit Details for the Settlement date chosen. I tried
this by creating macros, and I could
always get the form to open first, but I couldn't get the form to minimize.
Any help will be appreciated.

Thanks

You can adapt the following.

Create an unbound form.

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.
 
Hey Fred,

Thanks for the tip, it worked! Sometimes you work all day on a project your
brain freezes. Once I saw
the answer I smacked myself on the forehead. Thanks again!!!
 
Back
Top