• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 717
  • Last Modified:

"Run Time Error 3 - Return with No GoSub" on With

I get Error box:

"Run Time Error 3 - Return with No GoSub"

When I click "Debug" it displays the OnCurrent code at:

    With Me![InstrumentServices Query Subform].Form

No "Return" - no "GoSub" - why?

P.S. This only happen the FIRST time I open this form (after opening DB)
Private Sub Form_Current()
    With Me![StudentInstrument Subform].Form
        .Visible = (.RecordsetClone.RecordCount > 0)
    End With
    With Me![InstrumentServices Query Subform].Form
        .Visible = (.RecordsetClone.RecordCount > 0)
    End With
'    With Me![InstrumentComments Subform].Form
'        .Visible = (.RecordsetClone.RecordCount > 0)
'    End With
 
End Sub

Open in new window

0
MikeLong
Asked:
MikeLong
  • 3
  • 2
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Never seen that error before.

If you Debug>>Compile .... do you get any errors?

mx
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Try this:

Private Sub Form_Current()
    With Me![StudentInstrument Subform].Form
        .Visible = (.RecordsetClone.RecordCount <> 0)
    End With
    With Me![InstrumentServices Query Subform].Form
        .Visible = (.RecordsetClone.RecordCount <> 0)
    End With
End Sub
0
 
MikeLongAuthor Commented:
Thanks, I'll try "<> 0" Monday when I go back to work.

I'm guessing, now, that the problem lies with the fact that this is running under Office 2007, but it's an Access 2000 DB so I could do development at home if I needed to. (I'm off sick today (Friday). Otherwise I'd have the .mdb at home on my pen drive.)
0
 
MikeLongAuthor Commented:
Thanks, "<> 0" did the trick. Problem solved. Or perhaps, should I say, "worked around" as the RecordCount must be being reported as LESS THAN ZERO!
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
The RecordCount property is really only reliable if you test for Zero, or do a MoveLast and then get the Count.

mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now