Solved

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

Posted on 2008-06-18
5
665 Views
Last Modified: 2008-06-22
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
Comment
Question by:MikeLong
  • 3
  • 2
5 Comments
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
Never seen that error before.

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

mx
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Access MVP) earned 100 total points
Comment Utility
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
 

Author Comment

by:MikeLong
Comment Utility
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
 

Author Comment

by:MikeLong
Comment Utility
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
 
LVL 75

Expert Comment

by:DatabaseMX (Joe Anderson - Access MVP)
Comment Utility
The RecordCount property is really only reliable if you test for Zero, or do a MoveLast and then get the Count.

mx
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now