Return without GoSub error when opening form

BetterBeef

New Member
Joined
Mar 18, 2010
Messages
42
Hello,

I have been working on a specification database for a little bit now and it has worked for quite a long time. However, recently when I try to open the form after booting Access (2003 file using 2010 Access), I get the following error:

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

Here is my code for On Open:
Private Sub Form_Open(Cancel As Integer)
DoCmd.Maximize
DoCmd.SetWarnings Off
'DoCmd.GoToControl "ProductCode"
Me.Filter = "Status = 'Active'"
Me.FilterOn = True

SetFilterStatus ("Active")
Me.ProductList.Requery
Me.ProductCodeLkup.Requery
'gstrResponse = "Active"
'Link = ''

End Sub

Here's the other interesting thing... When I go into the code and debug it, I try loading the form again, and it works without error! I am thoroughly confused as to what I need to do. Any thoughts?

Chris
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Actually, I did something quite odd that fixed my problem. I simply went into the code itself and typed something, and then deleted the code, and it seemed to work. Any clue why that would have fixed it?
 
Upvote 0
Actually, I did something quite odd that fixed my problem. I simply went into the code itself and typed something, and then deleted the code, and it seemed to work. Any clue why that would have fixed it?

Yeah, the same thing that a decompile would accomplish (although a decompile would take care of situations not quite as light as yours). The problem is that occasionally the compiled code and the VBA editor get somewhat out of synch. What you ended up doing just got it back in synch when it recompiled when you ran it after saving. Sometimes that's all that is needed. Other times there may be situations where it is more in need of the full decompile process. But it is good you got it taken care of.
 
Upvote 0
Yeah, the same thing that a decompile would accomplish (although a decompile would take care of situations not quite as light as yours)..

Dear Mr. Larson

Great thanks for your advice and great experiance from future - it's still actual in 2016 :)
Hope you're well.

Regards
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top