Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

After macro is complete - want to open another database

Status
Not open for further replies.

mssbass

IS-IT--Management
Aug 24, 2001
53
US
How do I set up my macro to automatically close that database and open a brand new database on my c drive to run another autoexec macro?
 
You can use this code to open up the other access db

Private Sub Command12_Click()
On Error GoTo Err_Command12_Click

Dim stAppName As String

stAppName = "C:\Program Files\Microsoft Office\Office\msaccess.exe ""C:\Access File.mdb"""

Call Shell(stAppName, 1)

Exit_Command12_Click:
Exit Sub

Err_Command12_Click:
MsgBox Err.Description
Resume Exit_Command12_Click
End Sub

Please note the the path before the file is the location of the main access.exe file, it may be different on your machine, and make sure their is a space after the path name or it will not work.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top