Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

illegal operation 2

Status
Not open for further replies.

mikelane

MIS
Oct 5, 2001
7
GB
Hello,
When I close down Access I get "This program has performed an illegal operation" message.
This only occurs when I enter a report that uses vba code on loading so my labels can be printed from various positions on the page.
The vba code and 3 modules involved were pasted in from the "Developers Handbook Cd" so there should be no type-in errors. I have looked for obvious things like no "End if" but can't spot anything.
I don't know a lot about vba. Any general clues as what sort of things cause this error.
Thanks
Mike
 
A possible solution could be clearing object variables with:

set oVar = Nothing

I had a similar problem with variables of the form and recordset type. Sometimes msaccess did not close and stayed in the taskbar and some times it generated illegal operation errors.

Try to clear EVERY object variable after use.
 
If you have on close events, you could set a breakpoint and step through the code to find the line that is offending.
 
Thank you both. It was a variable that was open. I now close it with the report close event and all is well.

Thanks very much. Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top