Build ADE Through VBA

D

Derek Hart

Is there a way to build an ADE using VBA if I am in the ADP I wish to use to
create the ADE?

Derek
 
G

Guest

Only using sendkeys.

You would have to unload the ADP before you could use the
undocumented syscmd to create the ADE.

Access does this silently, which is why it always tries to run
your startup code after making an ADE. It has unloaded and
reloaded in order to create the ADE from the ADP. Access
can do this because it runs code outside the ADP to unload
and reload the ADP. You can put code in your ADP to unload,
but you won't be able to run code to reload. You could try
in a Wizard. I use a separate VB or VBS application.

(david)
 
D

Derek Hart

So I should use Sendkeys. That is okay?
Only using sendkeys.

You would have to unload the ADP before you could use the
undocumented syscmd to create the ADE.

Access does this silently, which is why it always tries to run
your startup code after making an ADE. It has unloaded and
reloaded in order to create the ADE from the ADP. Access
can do this because it runs code outside the ADP to unload
and reload the ADP. You can put code in your ADP to unload,
but you won't be able to run code to reload. You could try
in a Wizard. I use a separate VB or VBS application.

(david)
 
D

david epsom dot com dot au

Sendkeys is flaky and error prone, because you can't
ensure that your application will always have focus.
Also, you can't tell how long it might take to make
the ADE, so you have to go long, which makes it more
likely that you will forget and start something else
in the middle of the make. If that happens, the keys
will be sent to what ever application has focus.

Also, if you use Sendkeys, remember that Access will
unload your ADP to make the ADE, then reload it, so
your process will resume in the ADP start up code,
not continue in sequence.

Why do you want to run the code from inside the ADP?
Can you use a different ADP, or VBS or VB or VB.NET
or perhaps a wizard?

(david)
 
D

Derek Hart

I am making this as part of an administrator process to build versions for
clients. So this is only used by me. I am okay if the code runs again,
because I can trap for that with a command line parameter. So is sendkeys
the thing to use, or do you know of some other way to do this?
Derek
 
D

david epsom dot com dot au

Well, like I said, I use VBS or VB, not code inside
the file I want to make.

(david)
 
D

david epsom dot com dot au

.... But not inside the ADP that you are trying to convert.
The ADP has to be closed before you can use the syscmd.

(david)
 
D

Derek Hart

How do you use VB or VBS? What code?

david epsom dot com dot au said:
Well, like I said, I use VBS or VB, not code inside
the file I want to make.

(david)
 
G

Guest

The (undocumented) syscmd I mentioned:

app = createobject("Access.Application")
sInFile = "fred.mdb"
sOutfile = left(sinfile,len(sinfile) - 3) & "mde"
app.SysCmd 603, sInFile, sOutFile

I create an Access application object, (with no project
loaded) then use the syscmd.to build my files. If you
only have the runtime, you need another access file
(with no startup code) to let you create the application
object.

(david)
 

Ask a Question

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.

Ask a Question

Top