Small Macro Problem

sondriven

Registered User.
Local time
Today, 07:54
Joined
Jun 13, 2002
Messages
158
I have a Query that uses criteria from an Unbound form to select information to then view a report from.

You select the information on the form and I have a button to view the report. What I want to do is once the report is opened, then to close the information form.

Im having trouble doing this because, in the OnOpen Property of the Report I have a Macro that closes the Information Form.

The problem is that before the report opens completely from the Information Form. The criteria is gone and then the Form doesnt work. And I get the standard "Enter Name" "Enter Date" boxes.

Is there a way to do this if this all makes sense?

Thanks.
 
I haven't tried it but it should do OK:

In the VBA code of your button of the form, at the very end, (just before the «End Sub») add this:

DoCmd.Close (acForm), "Name of the form"

You can now get rid of your macro
 
Set the Forms visible property to no on opening the report, then close the form on the unload event of the report
 
That sounds good Rich. Im gonna try it. The other code didnt do anything.

Thanks.
 

Users who are viewing this thread

Back
Top Bottom