Close Pop up Report

A

alex

Hello all,

using Access '03...

It appears that the On Deactivate event does not fire on a pop up
report.

Does anyone have a way to close the report if it loses focus?

alex
 
M

Maarkr

Can u click on the Access Program Group in the toolbar and see the list of
open objects? Right click then select close.
 
A

alex

Can u click on the Access Program Group in the toolbar and see the list of
open objects?  Right click then select close.









- Show quoted text -

Hey Maarkr,

I was hoping to do this programatically, i.e., w/ VBA. I should have
been more specific.
 
B

BruceM

It seems not. I had not known that. From your brief description I'm not
sure where you would put this code, but it will close the report. Perhaps
it could be in the Activate event of a form, so when you click on the form
the report will close.

Dim strRpt as String
strRpt = "YourReportName"

If CurrentProject.AllReports(strRpt).IsLoaded Then
DoCmd.Close acReport, strRpt
End If

It may not be necessary to check whether the report is loaded. I'm not sure
why I do it that way, to tell the truth, but I think it is because at some
time I ran into error messages by trying to close a form that is not open.

You should be able to keep the report on top, forcing the user to close it
before going on, by setting its Pop-up and Modal properties to Yes.

If the Pop-up property is No you can close the report in its Deactivate
event, which fires when the report loses focus:

DoCmd.Close acReport, "YourReportName"

There may be some other options, depending on exactly what you are trying to
do.

Can u click on the Access Program Group in the toolbar and see the list of
open objects? Right click then select close.









- Show quoted text -

Hey Maarkr,

I was hoping to do this programatically, i.e., w/ VBA. I should have
been more specific.
 
A

alex

It seems not.  I had not known that.  From your brief description I'mnot
sure where you would put this code, but it will close the report.  Perhaps
it could be in the Activate event of a form, so when you click on the form
the report will close.

Dim strRpt as String
strRpt = "YourReportName"

  If CurrentProject.AllReports(strRpt).IsLoaded Then
    DoCmd.Close acReport, strRpt
  End If

It may not be necessary to check whether the report is loaded.  I'm notsure
why I do it that way, to tell the truth, but I think it is because at some
time I ran into error messages by trying to close a form that is not open..

You should be able to keep the report on top, forcing the user to close it
before going on, by setting its Pop-up and Modal properties to Yes.

If the Pop-up property is No you can close the report in its Deactivate
event, which fires when the report loses focus:

DoCmd.Close acReport, "YourReportName"

There may be some other options, depending on exactly what you are tryingto
do.






Hey Maarkr,

I was hoping to do this programatically, i.e., w/ VBA.  I should have
been more specific.- Hide quoted text -

- Show quoted text -

Thanks Bruce,
I used the Modal option and it works great!
alex
 

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

Similar Threads

Close on Lost Focus 2
Subform control OnClick firing 1
Resize Pop Up Form 4
Report Navigation 2
Close Pop Up 2
Requery a background form 2
Pop Up Form Focus Question 1
Pop Up Form Question 3

Top