Beware: I tested it and I got an error 7087 - "You can make an MDE file out
of the database while running Macro or Visual Basic code".
Since the constant acCmdMakeMDEFile doesn't accept any argument, there is no
way to modify this behaviour. However, the constant exists so it must be
useable somehow???
Dim a As Access.Application
Set a = New Access.Application
a.SysCmd 603, "db2.mdb", "db2.mde"
Set a = Nothing
--
Doug Steele, Microsoft Access MVP
(no e-mails, please!)
Van T. Dinh said:
Beware: I tested it and I got an error 7087 - "You can make an MDE file
out
of the database while running Macro or Visual Basic code".
Since the constant acCmdMakeMDEFile doesn't accept any argument, there is
no
way to modify this behaviour. However, the constant exists so it must be
useable somehow???
You code works fine if you run the code from another database different from
the one being used as the source for making MDE.
If the code is run in the source, it executes without errors but it doesn't
create the MDE either.
Terry Wickenden has sample code to use acCmdMakeMDEFile but it has the same
limitation. acCmdCompactDatabase and acCmdRepairDatabase have the same
limitation. The sample code has to use SendKeys also ...
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.