Skipping over AutoExec

  • Thread starter Thread starter Maria
  • Start date Start date
M

Maria

I am using visual basic to open a database, however, the
database is set up with an AutoExec Macro. How do I skip
over this with code. I know manually, I can hold down the
shift key while opening, but I would like to include this
in the code.

Thanks in advance for your help,
Maria
 
I did exactly what the article said (including adding the
ShowAccess function) and the autoexec still runs.

Any suggestions?

SendKeys "+"
Dim objAccess As Object
Set objAccess = CreateObject("Access.Application")
objAccess.Visible = True
SendKeys "+"
objAccess.OpenCurrentDatabase filpath:=NetworkFrontFile
 
I am using visual basic to open a database, however, the
database is set up with an AutoExec Macro.

I am wondering why you are bothering to open an Access object rather than
just attaching to the data with DAO or ADO directly. There is very little
you can do with an Access Application Object that you can't do better with
VB -- although VB is harder work, since you've started then surely there is
little to be gained by trying to run two GUIs at once.

Just a thought


Tim F
 
I was opening the Database so that I can export forms and
reports from the second database.

Can you do this with DAO?

Maria

P.S. I've attached a sample of the code that I'm using, so
that you can give suggestions...
'**********************************
Dim objAccess As Object
Set objAccess = CreateObject("Access.Application")

SendKeys "+"
objAccess.OpenCurrentDatabase NetworkFrontFile

With objAccess

Dim objReport As Object

For Each objReport In .CurrentProject.AllReports

..DoCmd.TransferDatabase acExport, "Microsoft Access",_
UserFrontFile, acReport, objReport.Name, objReport.Name

Next objReport

End With
'**********************************
 
Rather than exporting them from Database A into Database B, why not put code
in Database B to import from Database A?
 
Back
Top