Solved

Access 2010 Return without GoSub

Posted on 2014-07-31
3
1,244 Views
Last Modified: 2014-08-05
I have copied a database renamed & saved it. When I open the original Db and then press the button to 'Load New Events' it works fine. When I open the copied Db and press the 'Load New Events' I get the error message "The expression On Click you entered as the event property setting produced the following error: Return without GoSub"

However if I F11 to open the code then press the button to 'Load New Events' without even looking at the code it works.

Any expert have any ideas what is going on here?

Thanks
0
Comment
Question by:Jagwarman
  • 2
3 Comments
 
LVL 84
ID: 40231296
You could have one of several issues. Make a backup before you try any of these suggestions:

1. You may simply be missing a Reference. Open the new database, then open the VBA Editor and click Debug - Compile. If you have any missing references, the compile process should find those, and you'll get an errors that will point you in that direction. Remake the referenced, and then continue with the Compile. Fix any errors, and continue doing this until the menuitem is disabled.

2. You may have some corruption in the database. To try and fix that, first Compact the database, then Compile it (as above) and then Compact it again.
1
 
LVL 61

Expert Comment

by:mbizup
ID: 40231319
<<
 When I open the original Db and then press the button to 'Load New Events' it works fine. When I open the copied Db...
>> 

In addition to Scott's comments, the name of the database may have some importance in the code that could be causing the copied/renamed database to fail.

If the suggestions in his comment don't help, post the block of code that is failing.
0
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 40231321
>>> that could be causing the copied/renamed database to fail.

A quick test for that would be to move the original, working database temporarily, and place the copy in the original folder, giving it the same name as the original database.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

830 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