G
Guest
I have a pop up form that grabs some parameters and then opens a report.
When I open the report I hide the form (me.visible = false) and make a call
to a module that sets a property for the form being hidden (all this happens
before the report is actually opened). That works fine. When I close the
report I make the form visible again. No problem doing this either. My
problem happens when I close Access via the RED X button in the upper right
hand corner. I get the runtime error of 2467 that basically tells me that
the object (CallingForm) doesn't exist.
In the report close event I put I have the following statement:
If Not CallingForm is Nothing then
CallingForm.Visible = True
End If
CallingForm is the property in my module that is set (I do use Set property)
right before the call to open the report.
From what I can tell, when I close Access within the report object, then all
other objects are closed before the report object is closed. Therefore, when
the close event for the report object fires there is no CallingForm object
and thus the runtime error occurs. So, how do I hide a form and then make it
visible when the report closes via a normal report close event yet handle the
case where the report is open when Access closes.
Thanks,
Burnsie
When I open the report I hide the form (me.visible = false) and make a call
to a module that sets a property for the form being hidden (all this happens
before the report is actually opened). That works fine. When I close the
report I make the form visible again. No problem doing this either. My
problem happens when I close Access via the RED X button in the upper right
hand corner. I get the runtime error of 2467 that basically tells me that
the object (CallingForm) doesn't exist.
In the report close event I put I have the following statement:
If Not CallingForm is Nothing then
CallingForm.Visible = True
End If
CallingForm is the property in my module that is set (I do use Set property)
right before the call to open the report.
From what I can tell, when I close Access within the report object, then all
other objects are closed before the report object is closed. Therefore, when
the close event for the report object fires there is no CallingForm object
and thus the runtime error occurs. So, how do I hide a form and then make it
visible when the report closes via a normal report close event yet handle the
case where the report is open when Access closes.
Thanks,
Burnsie