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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open access from a form module

Status
Not open for further replies.

t1hodges

MIS
May 8, 2003
54
Im trying to open another visible access database from a button on a form, run a few queries, and then close, please advise.
 
The following code opens an acces db (the path is c:\x.mdb) and runs a macro called "xmac" (you can use docmd.openquery to launch the queries)

On Error Resume Next
Dim SysObj As Object

Set SysObj = GetObject("c:\SiadAus.mdb")
If Err.Number <> 0 Then
msgbox &quot;Error:&quot; & vbCrLf & Err.Description
End If

SysObj.Application.DoCmd.RunMacro &quot;xmac&quot;
If Err.Number <> 0 Then
msgbox &quot;Error&quot; & vbCrLf & Err.Description
Exit Sub
End If
Set SysObj = Nothing
 
thanks a bunch Arebelli, this is exactly what I needed!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top