Sub AccessTest1()
Dim A As Object
Set A = CreateObject("Access.Application")
A.Visible = False
A.OpenCurrentDatabase ("C:\mainCofAwork.mdb")
A.Run "Main"
End Sub
The code runs until it Reaches the A.Run.
That is when I receive the following error message
Microsoft Access can't find the procedure 'Main.@'
You may have used the run method in visual basic but
entered an invalid procedure name,
or you used the run method without first opening a
database.*You tried to use the OpenModule
method, but you used an invalid procedure name.
Thanks for your help,
Phillip
When you say you want to run a "Macro" do you mean a VBA
procedure within Access or a "macro" stored in Acces which
is a separate object Access tracks like a table, query,
etc.
If it's a truly a macro, which is not treated the same as
VBA code, then use the command:
A.DoCmd.RunMacro "Main"
If it's actualy VBA code, then your code below should work
save any spelling errors. Also make sure the VBA code is
a public routine if it is VBA.
-Tim
>.
>