How to set warnings on/off in Macro (1 Viewer)

djroller1

New member
Local time
Today, 16:37
Joined
Sep 10, 2014
Messages
2
I'm trying to create a macro in Access 2013 that runs a series of database inserts (appends). Normally I would do this using vba:
Sub MasterDataSets()
DoCmd.SetWarnings (False)
DoCmd.OpenQuery ("9a_create_CallPlanTrackerNational")
DoCmd.OpenQuery ("9b_append_Central_to_CallPlanTrackerNational")
DoCmd.OpenQuery ("9c_append_West_to_CallPlanTrackerNational")
DoCmd.OpenQuery ("9d_append_NorthEast_to_CallPlanTrackerNational")
DoCmd.OpenQuery ("9e_create_NewDeliverableActivity")
DoCmd.SetWarnings (True)
End Sub

I would like to run this as an autoexec macro, but I can't find an option to suppress the warning messages in the macro commands.

Any thoughts?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 21:37
Joined
Jul 9, 2003
Messages
16,280
Why not call the VBA subroutine from the autoexec macro? ( you can't call a sub routine but you can change it to a function and it will call)
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 13:37
Joined
Aug 30, 2003
Messages
36,125
That's also what I would do, but for informational purposes, in a macro there is a SetWarnings action, but you need to click on the Show All Actions button on the ribbon to see it.
 

Users who are viewing this thread

Top Bottom