I found some code that will open a database with a file name and run an access macro.
Example:
However i would like to skip the opening of a database and simply refer to the database that is currently open on my screen.![]()
Sub AccessTest1() Dim A As Object Application.DisplayAlerts = False Set A = CreateObject("Access.Application") A.Visible = False A.OpenCurrentDatabase ("Path of your database") A.DoCmd.RunMacro "Name of your macro" Application.DisplayAlerts = True End Sub
Is this possible?
Thanks
Bookmarks