Solved

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

Posted on 2008-06-18
5
683 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 - Microsoft MVP, Access and Data Platform) 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

617 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