Results 1 to 13 of 13
  1. #1
    securitywyrm is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    97

    The strangest "Returned without Gosub" error that vanishes when I look at the code

    I've encountered a peculiar error with my forms files several times over the past few months. The database will work fine for weeks with no changes to the structure, and then one day on a button click to open a file folder, I get a "Returned without Gosub" error. And the solution is to... view the code, make NO changes, close it, and it will work after that. Closing and re-opening the file does not fix it. It does prompt me to 'save changes' when I look at the code and then close the file, so "something" is getting changed, but I have no idea what, or why it needs to be changed.



    Any ideas what could be causing this? I am confident that no changes were made between the database working and not working, and I'm the only one who even knows what design view is among the people who use this system.

  2. #2
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    I've experienced the same issue occasionally over the years
    Possible early sign of corruption issues?
    Try decompiling, then recompiling then compacting - that should fix it!

    Obvious questions -
    1. is your database split?
    2. are users SHARING the same copy of the database (or FE database)?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  3. #3
    securitywyrm is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    97
    It's a split database, the form file is separate from the data file.
    Multiple users are using the file, but nobody else has the capacity to make changes to the file. It's locked down through the options and none of the other people using the file know what design view is.
    It is hosted over a network, and it's a government network, so it indeed might be corruption. If that's the case, it can mean big trouble.

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Multiple users are using the file, but nobody else has the capacity to make changes to the file. It's locked down through the options and none of the other people using the file know what design view is.
    That is not the point. When a user opens a front end, changes occur immediately behind the scenes. When they open a form or report, further behind the scenes changes occur. If you don't believe me, navigate to a .accdb, note the date/time modified. Open the file, then close it without making any changes. Check the date/time modified - it will have changed.

    multiple users using the same front end is a sure fire way of getting corruption. I fully concur with Colin, you are seeing the early signs of corruption. Each user must have their own copy of the front end located on their local device.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Quote Originally Posted by securitywyrm View Post
    It's a split database, the form file is separate from the data file.
    Multiple users are using the file, but nobody else has the capacity to make changes to the file. It's locked down through the options and none of the other people using the file know what design view is.
    It is hosted over a network, and it's a government network, so it indeed might be corruption. If that's the case, it can mean big trouble.
    The part I've highlighted in RED is all that matters.
    If more than one user is running the file at the same time, you WILL get corruption and it WILL mean big trouble
    Drop everything else, fix the file, then give each user their own copy of the FE on their own computer
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    No argument from me re the sharing of an FE, but this error also has a known cause. What I don't know is, if that cause results in the error every time, or just sometimes, depending on conditions. That cause is having a load event on a subform that references the parent form. This can be an issue since (as some of us probably know) the subform opens first, thus it's load event fires before the main form is open - thus the reference to the parent form cannot be resolved. It goes looking for the object or property being referenced, and returns without finding anything. This is just another one of those cryptic errors that aren't distinctly identified. What's missing of course, is the old Return command from BASIC, which is where this error message stems from.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Not saying I disagree with the subform call to a main form - but I would think that would be a consistent error every time and not fixed by going to the code

  8. #8
    securitywyrm is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    97
    A problem is that "Give each user their own copy of the file" means that I can't make updates to the file. We still have issues with certain paperwork forms where people will turn in the form from five years ago because they had a local copy saved. I will try the decompile/recompile thing, but for now is there some other way I can make the database more robust against corruption?

    The boss says they want "one file" that "everyone uses" and my attempts to persuade that this was not a good idea were met with managerial resistance.

  9. #9
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    but for now is there some other way I can make the database more robust against corruption?
    against multiple users using the same front end? no

    There are complex ways of trying to ensure only one user can access the front end at any one time but they are not infallible and I can't recommend them.

    A problem is that "Give each user their own copy of the file" means that I can't make updates to the file.
    you can't at the moment anyway if another user is using the db. there are plenty of ways to distribute a front end to a user and to prevent the front end being used from the server location. just google 'distribute access front end to users'

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Quote Originally Posted by securitywyrm View Post
    A problem is that "Give each user their own copy of the file" means that I can't make updates to the file. We still have issues with certain paperwork forms where people will turn in the form from five years ago because they had a local copy saved. I will try the decompile/recompile thing, but for now is there some other way I can make the database more robust against corruption?

    The boss says they want "one file" that "everyone uses" and my attempts to persuade that this was not a good idea were met with managerial resistance.
    Some of that is not true. Suggest you don't give up on the promotion of a 1 db 1 user policy, but you need to learn more about how to administer it so that you're better prepared to overcome narrow minded thinking. While there are several ways to accomplish this, one is:
    you have a master fe (and a backup of it). When you "update" you replace the master in the folder that everyone copies from. This new master has a version number (easiest is probably a table entry) which you also update in a be table. When they open their copy from a desktop shortcut, startup code compares the fe version to the be version number. If not the same, close the fe after presenting a message about the problem. I'd lean towards having them click another desktop icon to download a copy of the fe to their personal network folder (or wherever their copy should be kept) but you could do it automatically. Thus, they can't use old versions. This could also be done if a commonly shared setup, but most/many seasoned developers won't follow that model unless they have to. If you have to, then incorporate version checking. That should take care of users having unauthorized copies. You could also have location checking - if the fe currentpath property doesn't match what's authorized, again, close but with a different message.

    Another way is to have a subfolder for each user where a copy of the latest fe is located and you over-write those files when you update. Problem with that is you can't overwrite if their db is open at the time. You would then need to include version checking between a be table and the fe code.

    As long as you have to use a shared fe, asking how to avoid corruption is pretty much a non-starter.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  11. #11
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    The boss says they want "one file" that "everyone uses" and my attempts to persuade that this was not a good idea were met with managerial resistance.
    the situation is not an access issue, it is a fact of life. Why do you think an excel file can only be opened with full access by one person at a time - and everyone has their own copy of the excel app. Same goes for any other app you can think of.

    Even web browsers load their own copy of the web page ever time it is opened, no one is sharing it.

  12. #12
    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

  13. #13
    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
    securitywyrm,

    I recommend that you and your boss take the advice given to heart.
    Here is an FMS link outlining the issue/topic of not sharing FE.

    Good luck.

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

Similar Threads

  1. Replies: 2
    Last Post: 12-23-2015, 09:32 PM
  2. Replies: 3
    Last Post: 02-06-2015, 03:22 PM
  3. Help "Return without GoSub" Error message
    By Danny Schultz in forum Forms
    Replies: 1
    Last Post: 10-25-2013, 09:14 PM
  4. Replies: 7
    Last Post: 08-14-2013, 03:57 PM
  5. Replies: 5
    Last Post: 06-19-2012, 03:16 AM

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