On Close Event

  • Thread starter Thread starter George Nicholson
  • Start date Start date
G

George Nicholson

Is the Form Open?

Setting Visible to True won't open a form that isn't already open, it just
makes an already open, but hidden, form visible.

HTH,
 
Are you printing from a command button on frmReportDates? If so, what is
the command button code? If not, is frmReportDates open? If it is not,
making it visible won't do anything. You would need to open it instead.
 
I am printing a report, on the On Close event of the report I have.
Forms!frmReportDates.Visible=True
After the report prints the form doesn't appear.
I am not previewing the report before I print...
I'm using..
DoCmd.OpenReport "rptTest"
Does the form not appear because the report never opens when it prints?
How can I accomplish making the form reappear after the report prints?
Thanks
DS
 
BruceM said:
Are you printing from a command button on frmReportDates? If so, what is
the command button code? If not, is frmReportDates open? If it is not,
making it visible won't do anything. You would need to open it instead.
Yes I am printng from a command button on frmReportDates.
frmReportDates is set to invisible....
the code is...

DoCmd.OpenReport"rptTest"
Forms!frmReportDates.Visible=False
 
George said:
Is the Form Open?

Setting Visible to True won't open a form that isn't already open, it just
makes an already open, but hidden, form visible.

HTH,
Yes the form is open, it's just invisible.
DS
 
DS said:
I am printing a report, on the On Close event of the report I have.
Forms!frmReportDates.Visible=True
After the report prints the form doesn't appear.
I am not previewing the report before I print...
I'm using..
DoCmd.OpenReport "rptTest"
Does the form not appear because the report never opens when it prints?
How can I accomplish making the form reappear after the report prints?
Thanks
DS

Are you certain the report's Close event is firing? Put a breakpoint in that
event code and make sure you are reaching that point.

Carl Rapson
 
I think Carl nailed it when he suggested that the Close event does not run.
I checked it out, and it appears Close does not run unless you open the form
in Preview mode first:
DoCmd.OpenReport "rptTest", acViewPreview
There may be other ways to get the Close event to run, but not if you print
the report directly as you have done. For that matter, why hide
frmReportDates at all if you are not going to look at the report? Or did
you mean to look at the report before printing it?
 
DS said:
Your right, when it comes down to it I didn't have to hide that form at
all. So now at least I know when you print the report it never opens Good
for future reference.
Thanks
DS

Glad to hear it's working OK. Good for future reference for me, too.
 
BruceM said:
I think Carl nailed it when he suggested that the Close event does not run.
I checked it out, and it appears Close does not run unless you open the form
in Preview mode first:
DoCmd.OpenReport "rptTest", acViewPreview
There may be other ways to get the Close event to run, but not if you print
the report directly as you have done. For that matter, why hide
frmReportDates at all if you are not going to look at the report? Or did
you mean to look at the report before printing it?
Your right, when it comes down to it I didn't have to hide that form at
all. So now at least I know when you print the report it never opens
Good for future reference.
Thanks
DS
 
Back
Top