Solved

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

Posted on 2008-06-18
5
668 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
ID: 21818721
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
ID: 21818725
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
ID: 21827639
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
ID: 21842235
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
ID: 21842247
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

910 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

23 Experts available now in Live!

Get 1:1 Help Now