Link to home
Start Free TrialLog in
Avatar of MikeLong
MikeLongFlag for New Zealand

asked on

"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

Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Never seen that error before.

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

mx
ASKER CERTIFIED SOLUTION
Avatar of DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
DatabaseMX (Joe Anderson - Former Microsoft Access MVP)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MikeLong

ASKER

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.)
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!
The RecordCount property is really only reliable if you test for Zero, or do a MoveLast and then get the Count.

mx