By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,626 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,626 IT Pros & Developers. It's quick & easy.

On Load Error: Return Without GoSub

anoble1
100+
P: 230
When I click and open my database I get the following error: "The expression On Load you entered as the event property setting produced the following error: Return without GoSub."

I click OK,

My form comes up. Then Another message comes up saying:
"The expression On Timer you entered as the event property setting produced the following error: Return without GoSub"

On my form I do have a Testbox that shows the Time and Date. I named it Timer1.

So, then I click OK, well the timer doesn't work. Also compact and repair wont fix it.

HOWEVER, when I open up the VB Editor, and close it and hit compact and repair no errors occur. But this keeps happening when I close and open the DB.

Please Help, thanks
Jul 16 '10 #1
Share this Question
Share on Google+
6 Replies


ADezii
Expert 5K+
P: 8,703
@anoble1
There isn't much we can do until you post your code for the Load() and Timer() Events.
Jul 16 '10 #2

anoble1
100+
P: 230
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2. On Error GoTo errHandle
  3. Dim sqlStatement As String
  4. Dim strReturn As String
  5.  
  6. 'Set user status=Logged in
  7. Dim strSQL As String
  8.  
  9. strSQL = "UPDATE tblReviewNames SET tblReviewNames.SignedIn = True WHERE (((tblReviewNames.NTID)='" & Environ("UserName") & "'));"
  10.  
  11. DoCmd.SetWarnings False
  12. DoCmd.RunSQL strSQL
  13. DoCmd.SetWarnings True
  14.  
  15. 'strReturn = PlayMP3("S:\Workgroups\APC Power Delivery-Contract Services\Student Engineer\Anyway You Want It.mp3")
  16.  
  17. 'Set UserName to the NTID of the use logged on to the machine
  18. UserName.value = Environ("username")
  19.  
  20.  
  21. 'Check Permissions for Admin
  22.  
  23. Me.cmdOpenAdmin.Visible = Permissions("Admin")
  24. sqlStatement = "SELECT tblCustomer.*, tblSubs.SubName, tblReviewNames.Name, tblDivisions.DivisionName, tblOpArea.OpAreaName FROM ((tblDivisions INNER JOIN (tblSubs INNER JOIN tblCustomer ON tblSubs.SubID = tblFeeder.Sub) ON tblDivisions.Division = tblCustomer.Division) LEFT JOIN tblReviewNames ON tblCustomer.LCS = tblReviewNames.NameID) INNER JOIN tblOpArea ON tblCustomer.OpArea = tblOpArea.OpAreaID;"
  25.  
  26. SetSQL "SELECT tblCustomer.Active, tblCustomer.IssueDate, tblCustomer.CompleteDate, tblCustomer.Comments, tblCustomer.LCS, tblSubs.SubName, tblDivisions.DivisionName, tblOpArea.OpAreaName, tblReviewNames.Name, tblCustomer.ID FROM tblSubs INNER JOIN (tblReviewNames INNER JOIN (tblOpArea INNER JOIN (tblCustomer INNER JOIN tblDivisions ON tblCustomer.Division = tblDivisions.Division) ON tblOpArea.OpAreaID = tblCustomer.OpArea) ON tblReviewNames.NameID = tblCustomer.Name) ON tblSubs.SubID = tblCustomer.Sub;", sqlStatement
  27. Me.frmAll.Form.Requery
  28.  
  29. DoCmd.Minimize
  30.  
  31. Exit Sub
  32.  
  33. errHandle:
  34. 'Print the error message and send an email to Administrator
  35. SendErrorMsg "Form_Load on frmMain", Err.Number, Err.Description
  36. 'MsgBox Err.Description
  37. Exit Sub
  38.  
  39. End Sub
Now the Timer

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2. [Timer1] = (Now)
  3. End Sub
Jul 16 '10 #3

NeoPa
Expert Mod 15k+
P: 31,769
I see no problems with the code. What happens when you try to compile it?
Jul 16 '10 #4

anoble1
100+
P: 230
Well, very weird thing Happened. It automagically started working again. It has been broken since Wednesday. You must bring mysterious luck to my program.
Thanks for the help
Jul 16 '10 #5

NeoPa
Expert Mod 15k+
P: 31,769
That's IT Person Syndrome.

As soon as a member of IT is standing over your shoulder, no matter how consistently the problem showed itself all those other times before you reported it, the problem hides until you are alone again.

No-one has yet been able to determine how these bugs can tell!
Jul 16 '10 #6

100+
P: 675
I have found the same phenomena occurs at my auto mechanic and my doctor. Therefore, the gremlins that inhabit my car and the 'germs' that inhabit me can also tell!
Jul 16 '10 #7

Post your reply

Sign in to post your reply or Sign up for a free account.