On Current Error Message

Tophan

Registered User.
Local time
Today, 05:04
Joined
Mar 27, 2011
Messages
389
Good Morning,

I changed an existing form to a tabbed form so I could add a second subform. This is causing an error when I first open the form which says "The expression On Current you entered as the event property setting produced the following error: Return without GoSub".

The only On Current event is the following on the main form
Code:
Private Sub Form_Current()
Me.frmTaskSheetDtls.Form.cboJobName.Requery
End Sub

frmTaskSheetDtls is the original subform

The form is still working but it's just this message when I first open the form. If I close and reopen the form without closing the database the message does not appear.
 
I googled this and found the following.
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.
 
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.
Recent versions of Access will remove any empty procedures.
To ensure that doesn't happen in this case, add a comment line e.g.

Code:
Private Sub Form_Load()
'this is a dummy procedure as a test
End Sub

For info, empty procedures are now automatically deleted because such procedures used to prevent compiling of ACCDB files to ACCDE
 
I already have an event in the On Load on my main form :(
 
I really wish I could but unfortunately I can't upload the database as it has been in use for 3 years and has some sensitive info in it.
 
Success. I did the following on the Before Update event and it worked!
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
this is a dummy procedure as a test
End Sub

As always...thanks for everyones help :)
 
Congratulations. Hopefully you remembered the comment quote mark at the start of the line
Somewhat surprised that using that event worked....:giggle:
 
Yes...I had to go back and add the apostrophe. Don't know why it worked either but it did 🤷‍♀️
 

Users who are viewing this thread

Back
Top Bottom