Event procedure in form just quit working

I am working in Access 2003.  I downloaded a trial of Access 2013. They are both installed. In 2003 the form throws an error. It continues to run if i open it from  2013. The form has a drop down combo box linked to a query. There are two other fields on the for that get updated by an After Update event procedure.

Private Sub Customer_Code_AfterUpdate()
Me.[Last Name] = Me.[Customer Code].Column(2)
Me.[First Name] = Me.[Customer Code].Column(1)
End Sub

Open in new window

Is there a way to get 2003 and 2013 to play nice?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dale FyeOwner, Developing Solutions LLCCommented:
Not really.

If you have an application written in 2003, and you opened it in design view in 2013, you might not even be able to open it in 2003 any more.

One of the Access MVPs (John Viescas) has written some code that will strip out all of the stuff that gets inserted in 2003 forms and reports when you open them in 2010 or 2013.  That code is available for download at:  http://viescas.com/category/links/downloads/

Actually, the FixBroken.zip file located on his website is designed to fix the problems caused by opening a 2007 accdb with 2010 or 2013, so this might not work, but it would be worth a try if you don't have a backup copy of the 2003 version available.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Access simply doesn't play nice with multiple installed versions which is why the recommendation is to always use a VM to run different versions.  That said, I have had successful multi-version installations.  There are some things to keep in mind.
1. Always install the oldest version first.
2. Make sure they are installed in separate directories.
3. Make sure you are logged on with administrator privileges because switching versions requires the version you are opening to take over the registry from the last version that ran and updating the registry requires administrator privileges.
4.  Don't EVER double click on a database file.  ALWAYS open the Access version you want to run and then open the .mdb/.accdb.
5. If you ever have a situation where a client must have two Access versions, create shortcuts for EACH AND EVERY application to ensure that the correct version of Access is being opened.  The shortcuts should open the specific version of Access and pass in the database name as an argument.  NEVER rely on the file association since that will always assume you want to use the same version you ran last time.
Jeffrey CoachmanMIS LiasonCommented:
Also a little background is needed:
    "In 2003 the form throws an error. It continues to run if i open it from  2013."
So you are saying that the code ran fine *before* you installed 2013?

 "the form throws an error."
And the error is...?

I don't see anything in your code that would work in 2013,...but not in 2003.

FWIW, ...If it were me, I would "pull in" the first and last names instead of "inserting" them.
I would do this by selecting the ID in the comboox, then using SQL to bring (Link) in the names.
In this way, if ID number 47 changed their name, it would always update,
If you "Insert" the names, ...they are forever "hardcoded".
Jeffrey CoachmanMIS LiasonCommented:
...or use the Dlookup() function to lookup (find) the names...
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<Also a little background is needed:
    "In 2003 the form throws an error. It continues to run if i open it from  2013."
So you are saying that the code ran fine *before* you installed 2013?>>

  The other point here is that you may be barking up the wrong tree with this.   Whenever you switch a DB between versions, out side of the feature set offered, there is always the issue of different versions executing at different speeds.   The same issue can exist because of faster/slower PC's.

 If you do something you shouldn't be doing (like trying to over ride events or triggering other events from inside an event), you can see differences in the order of execution when you switch versions or machines, which can lead to errors.

 This stems from the fact that it's easy to forget that "Access" is really made up of three separate things all working together; Access (the UI and model), VBA, and JET/ACE.    Most think of "Access" as being monolithic, but it's not.  JET/ACE alone for example has three separate threads of execution by default.

 That can lead to subtle variances when moving between versions or machines.  For example, a form open in A2013 may take slightly longer than in A2003 because of the additional features in it and in that event, you referenced a control.

 Controls are not guaranteed to be fully instantiated until the OnLoad event, but many work with controls in the open event because the open event is cancel-able where as the OnLoad is not.    So when you move to A2013 (or a slower machine), you might see an error referencing the control.

  The reverse can also be true; something that executes faster can lead to errors as well.

 So the real question is, what's the error?

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.