Problems using Ac2007 and Ac2000 Code wont run

jacc14

New member
Local time
Yesterday, 23:50
Joined
Apr 17, 2010
Messages
4
Hi. I am running the DoCmd.RunCommand acCmdLinkTables in my Access 2000 program. However I have given this program to someone who uses Access 2007 and it wont run that code. I have found a solution but rather than have two versions running I wondered if you could put an if statement to say that if its AC2000 then run this code but if AC2007 then run the other code.?

Thanks
Christine.
 
I used to do this on my splash screens: Capture the version with "Application.Version" and based on the result you could use it in an if statement to run version specific code. There's likely a better way but this is one simple way around it. The responses you'll get is an OFFICE version like: 11.0 for 2003, 12.0 for 2007, I'm not sure about the others, but you can do a debug.print application.version in the immediate window of your VBA editor and it'll tell you your current OFFICE version.
 
Thanks for this . Great advice
 
The code should work in both versions but you have to ensure that the Access 2007 has the database location set up as a Trusted Location.
 

Users who are viewing this thread

Back
Top Bottom