“Return without GoSub” when using subforms in Acce

2019-04-19 10:05发布

问题:

Why do I get a

"Return without GoSub"

error when using subforms in Access 2007?

回答1:

This can occur when there is a Form_Load() event in the subform, but not the main form. Try adding an empty Form_Load() event to the main form.



回答2:

The most likely reason for this error is that the project has become corrupt. You should decompile, instructions are here: Debug a bad DLL calling convention error

First, ensure that you have switched off Name Autocorrect: http://allenbrowne.com/bug-03.html and ensure that you are not missing any references.



回答3:

I found a useful solution (in my case) for that same issue at http://www.fmsinc.com/microsoftaccess/performance/decompile.asp . It worked as a charm for me. HTH Phil



回答4:

Performing a decompile of the VBA code and recompiling followed by compacting my database resolved the issue for me.