
Program from access 97 won't work in access 2000
GoToControl works in Access 2000 the same as it did in Access 97.
Did you get any error messages when you converted the app? For example, an
error message saying that 'the VBA project may be corrupted?' If so, on
every occasion except one that I experienced that problem, I was able to
solve it by decompiling and then recompiling in Access 97 and then
reconverting to Access 2000. On the one occasion that didn't work, I was
able to import the objects from the Access 97 MDB into a new, empty Access
2000 MDB.
Some of what follows may be difficult for a non-programmer to follow, but
I'll explain it as best I can, so you can decide whether you want to try it
yourself or find someone with Access development experience to help.
First, make a copy of the Access 97 MDB, and try all of this on the *copy*,
just in case.
To decompile in Access 97 (if you no longer have Access 97, you'll need to
copy the Access 97 version of your application to a PC that still has it)
start Access from the Start menu 'Run' dialog with the following command
line:
"full path to msaccess.exe" /decompile "full path to MDB"
For example, on my system, where Access 2000 is installed in a 'V09'
subfolder off the 'Microsoft Office' folder:
"C:\Program Files\Microsoft Office\V09\Office\MSACCESS.EXE" /decompile
"C:\My Documents\SomeFile.MDB"
Note the placing of the quotes - they're necessary if there are spaces in
the path, but the /decompile is outside the quotes.
When you've decompiled, open any module and choose 'Compile and Save All
Modules' from the 'Debug' menu.
You say this program was written 'many years ago'. Is it possible that it
was originally written in Access 2, and later converted to Access 97? If so,
it may still include a reference to the DAO 2.x/3.x Compatibility Library.
(Open any module and choose 'References' from the 'Tools' menu to see what
references are checked.) In that case, still in Access 97, you will need to
remove that reference and replace it with the DAO 3.51 (or DAO 3.50, if you
don't see 3.51 listed) Object Library, then select 'Compile and Save All
Modules' from the 'Debug' menu. Attempting to compile will highlight any old
DAO 2.x code that needs to be modified. These include:
BeginTrans, CommitTrans and Rollback are now methods of the Workspace
object, not the Database object.
RecordsetName.FieldName (eg rst.SomeField) needs to change to
RecordsetName!FieldName (eg rst!SomeField).
I'm a big hazy on this next one, as it didn't occur very often in the apps I
converted, but the old DAO 2 syntax for assigning a QueryDef changed too. I
*think* the old syntax went something like 'Set qdf =
db.OpenQueryDef("QueryName")' - I may not have that exactly right, but
attempting to decompile will highlight any QueryDef assignments that need to
change. The new syntax is 'Set qdf = db.QueryDefs("QueryName").
--
Brendan Reynolds
Quote:
> When I updated my computer from access 97 to access 2000 a
> program written in VBA, that someone else wrote many years
> ago, will not work in access 2000. When I run the de{*filter*}
> several different problems come up, like "GoToControl" is
> no longer available. I am not a programmer so I do not
> understand what the problem is. Any ideas?
> James Patterson