Avoid runnign the autoexec macro

R

Rodrigo

How to I stop the autoexec macro from running when openning a database
trough automation?

Private Function OpenThisDB()
On Error Resume Next
Dim oAcc As Access.Application
Dim oDB As Database

Set oAcc = New Access.Application
Set oDB = oAcc.DBEngine.OpenDatabase("c:\tmp.mdb", False, False)
oAcc.OpenCurrentDatabase "c:\tmp.mdb", False
' how to avoid the AutoExec macro
' and the form in on the database startup properties
' from start running here
oAcc.CloseCurrentDatabase
Set oDB = Nothing
Set oAcc = Nothing
End Function

Thanks,

Rodrigo.
 
R

Rodrigo

Great!

How about the form in the startup properties. I specially would like to to
this without having to change the database properties before opening the
database (to stop it from opening that form). Also most of the databases
that I am automating have the AllowBypassKey set to false, any way to avoid
this withtout changing it to true first?. Though if it's not posible, I can
change them (both the form and the AllowBypassKey), open the database and
then change them back.

Thanks,

Rodrigo.
 

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