Form's acting up!!

The Bey

Registered User.
Local time
Today, 11:34
Joined
Jun 21, 2011
Messages
84
I don't know why but my database was all working fine and then I saved, closed and reopened, and now on one of the forms it keeps coming up with the message:

"The expression On Current you entered as the event property setting produced the following error: Return without GoSub."

This message appears whenever I click any button on this form until I open up the module. When I open the module, I don't edit anything, just open it then close it, and then the problem goes away until the database is reopened.

What does this mean and why is it happening?!
 
Go to the VBA Window, and then go to DEBUG > COMPILE on the menu and it should take you to an error that you have. Fix that error and then repeat until there are no more errors.
 
Thanks for the help Bob. It didn't find any bugs so instead I used a previous database and redid the lost work. It doesn't seem to be playing up.

Hopefully I haven't just masked the problem and it won't come back to bite me in the ass
 
Glad you got the problem fixed. I doubt that the problem will recur, but for future reference, this type of error typically, in my experience, comes from some carelessness in copy and pasting code into the code module so that one event is pasted into the middle of another event, like

Code:
[COLOR="RoyalBlue"][B]Private Sub Form_Current()[/B][/COLOR]
 
[B][COLOR="Red"]Private Sub cmdClose_Click()
 DoCmd.Close
End Sub
[/COLOR][/B] 
 [COLOR="RoyalBlue"][B]If IsNull(Me.TargetControl) Then
  Me.TargetControl.Locked = False
 Else
  Me.TargetControl.Locked = True
 End If
End Sub[/B][/COLOR]
so that one Sub opens and before it completes running a second Sub opens, generating the "Return without GoSub" message.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom