aarondewberry
IS-IT--Management
Hi all
I have this code to open up access, using VB in Business Objects, and to run a macro.
Heres the trick, the access database is already open when I use this code, so it opens up a second instance of the same database... confusing.
How can I modify this code to just switch back to the open access database and then run the macro?
Hope this is clear!
I have this code to open up access, using VB in Business Objects, and to run a macro.
Code:
Public Sub OpenAccess()
Dim app As Access.Application
Set app = CreateObject("Access.Application")
app.OpenCurrentDatabase ("*** Your database path in here ***")
app.Visible = True
app.DoCmd.RunMacro ("M1")
Set app = Nothing
End Sub
Heres the trick, the access database is already open when I use this code, so it opens up a second instance of the same database... confusing.
How can I modify this code to just switch back to the open access database and then run the macro?
Hope this is clear!