Return without gosub error 3 when requerying a combobox

E

EdA

In Access 2007, I have a combo box that I perform a requery on based on the
on change event of another combo box. Suddenly I started receiving the error
message Return without gosub error 3 when I clicked the drop down triggering
the event. When I go to the debugger the code that it is stopped on is the
requery method of the combobox.

For some reason the issue stopped occurring after I edited the vba code
without making any actual changes (just some returns etc.). The error is not
occurring anymore but I would like to know what might have caused this and
why strange things like this happen in Access.
 
M

Marshall Barton

EdA said:
In Access 2007, I have a combo box that I perform a requery on based on the
on change event of another combo box. Suddenly I started receiving the error
message Return without gosub error 3 when I clicked the drop down triggering
the event. When I go to the debugger the code that it is stopped on is the
requery method of the combobox.

For some reason the issue stopped occurring after I edited the vba code
without making any actual changes (just some returns etc.). The error is not
occurring anymore but I would like to know what might have caused this and
why strange things like this happen in Access.


That sounds like your code project is/was corrupted. Making
an inconsequential change such as typing a space at the end
of a line will dirty the module and cause a partial compile.
The compile will then shake the code project, which
**might** clear the corruption. However, it is more likely
to cause the corruption to shift to another point and
probably make it worse. Way better is to decompile your
project, which discards all the compiled code (and any
corruption in the compiled code).

The most common cause of this kind of corruption is editing
a form/report module when the form/report is not in design
view. The idea of debugging and fixing code while running a
form/report is nice but it is also extremely complex and
notoriously dangerous. I have had a catastrophic corruption
just because I inadvertently bumped the space bar while
reading some code for a running form.

Difficult as it may be, it is a good idea to develop the
habit of always switching a form/report back to design view
before making any change to its code.

For some details on this issue, see:
http://www.trigeminal.com/usenet/usenet004.asp?1033
 

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

Top