Results 1 to 8 of 8
  1. #1
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126

    Return without GoSub

    I set up a list box of report names and click on a button and can I open the selected report. I close the DB and reopen it and when I try to open the same report I am getting the message Return without GoSub.


    I have no idea how to correct this issue.

    Jim O

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2013
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Can you post the code you created for the list box and report
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716

  4. #4
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126
    It is a Macro run from a button click. The List Box is called RptList fed from a table with a reportID the system name of the report and a descriptive name of the report. It worked when I first set it up but I closed the database and when I reopened it I get the error message.

    Code:
    =[RptList].[Column](1)
    Jim O

  5. #5
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    what's the rest of the call to open the report? You can't refer to the entire column of one listbox to open one report. If you're going to use the column method, you'll have to include the row. Otherwise, use the ItemSelected property of the listbox, assuming the bound field contains the report name. Do you have so many reports that you need a listbox instead of a combo box, using its AfterUpdate event to open the report that the combo displays? That would be easier.

    What, if anything, did you glean from the provided link? Did you try any of the suggestions there?

  6. #6
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126
    I am not sure what is going on. Sometimes when I open the data base it will work just fine but if I close the DB and reopen sometimes it wont work. Sometimes if it is not working I can go to design view and then go back to form view and it will work. It is a puzzle and my knowledge of Access, being very slight, does not help. It is more of a learning experience than something I have to have work as planned, I can work around the issue. Just trying to understand it.

    Jim O

  7. #7
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    Sounds like some sort of corruption.
    Make a backup.
    I've had success with this technique. It consists of deleting code, compacting, then pasting code back.
    Do this for each form, report and module. Use CTRL-X to cut the code, do a compact/repair, then paste the code back to the same place. Compact/repair, then repeat on next form, report or module until all are done.

  8. #8
    JimO is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    Dec 2015
    Posts
    126
    I tried compacting with no positive result. I will keep fussing with this for a while but for now I will just set up some buttons to open the reports.

    Thanks to all for their time and input.

    Jim O

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

Similar Threads

  1. Help "Return without GoSub" Error message
    By Danny Schultz in forum Forms
    Replies: 1
    Last Post: 10-25-2013, 09:14 PM
  2. Replies: 1
    Last Post: 05-01-2013, 05:45 PM
  3. GoSub Error
    By rperrosx in forum Access
    Replies: 1
    Last Post: 12-20-2012, 02:42 PM
  4. Replies: 1
    Last Post: 06-06-2012, 01:28 PM
  5. 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