I have objApp declared as an Outlook.Application object for a form. (I mean at the top so that it has scope for the whole form)
During the use of the form people may or may not set objApp to be the Outlook Application and get other objects like a mailitem object or appointment object. They use this in other parts of the form so I do not set the objects to nothing.
In the close event I thought this would be good housekeeping
When Access closes down (and compacts on close down) I get that Access has a problem and I have a check box to back up the MDB.
Irrespective of the choice. When I reopen the MDB I cannot get into the VB Editor. But it still runs.
If I copy the form object and rename it then the form is ok and I can open it with VB Editor.
One other interesting thing is that if I delete the form object I get an extra request about information on the clipboard. This does not usually happen when you delete a form.
During the use of the form people may or may not set objApp to be the Outlook Application and get other objects like a mailitem object or appointment object. They use this in other parts of the form so I do not set the objects to nothing.
In the close event I thought this would be good housekeeping
Code:
if not objApp is nothing then
set objApp = nothing
end if
Irrespective of the choice. When I reopen the MDB I cannot get into the VB Editor. But it still runs.
If I copy the form object and rename it then the form is ok and I can open it with VB Editor.
One other interesting thing is that if I delete the form object I get an extra request about information on the clipboard. This does not usually happen when you delete a form.