Results 1 to 8 of 8
  1. #1
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    145

    Return without GoSub error

    I have a form that has 12 labels. 6 labels open a report when clicked and 6 labels open a form. I opened my DB recently and all labels give the error below when clicked.

    "The expression On Click you entered as the event property setting produced the following error: Return without GoSub"



    This hapened out of the blue when I opened the database. It was working fine when I closed it the last time.
    I can't find the answer anywhere. Any help would be apprciated. DB attached
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    I get compile errors due to none of these controls existing on the form:

    Code:
    Private Sub Label174_Click()
      Me.CategoryCortinaFilter = "*"
      Me.VenueCortinaFilter = "*"
      Me.GenderCortinaFilter = "*"
      Me.CategoryLAFilter = "*"
      Me.VenueLAFilter = "*"
      Me.GenderLAFilter = "*"
    End Sub
    I'd fix that first.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    By the way, it appears you may have deleted that label, but its code remains so delete that too.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    145
    Those controls were on the form but I deleted them before posting as I thought they might be a problem. I was getting the error before and after the deletions

  5. #5
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    145
    I corrected the code and the form is working as designed. I'll wait to post solved as I believe the error has returned in the past when no changes have been made except closing the database

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Sounds good. Those were the only code errors I saw, other than these statements should be at the top of every module:

    Option Compare Database
    Option Explicit

    More:

    https://www.baldyweb.com/OptionExplicit.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    JonathanT is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2011
    Posts
    145
    Thank you!!

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help and good luck! Hopefully that error doesn't reappear.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Error message "return without gosub"
    By msmithtlh in forum Forms
    Replies: 0
    Last Post: 03-09-2020, 11:00 PM
  2. Help "Return without GoSub" Error message
    By Danny Schultz in forum Forms
    Replies: 1
    Last Post: 10-25-2013, 09:14 PM
  3. Replies: 1
    Last Post: 05-01-2013, 05:45 PM
  4. Return without Gosub
    By tomk in forum Access
    Replies: 2
    Last Post: 06-11-2010, 03:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums