Macro RunSQL Statement Message Suppression

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a macro with a list of RunSQL statements in it that delete records and apend records to a table, but I dont want the Message "You are about to delete x rows from table...do you want to continue Yes/No" and Your about to apend x rows are you sure you want to continue Yes/No" messages to pop up each time I run the macro. I'm sure this is very simple to do but could someone please tell me how to disable/suppress the messages?
Many Thanks,
BD
 
Make the first action in your macro a SetWarnings action. Leave the
Warnings On property set to 'No'. Most important, make the last action in
your macro another SetWarnings action, but set the Warnings On property to
'Yes'.

hth,

--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Barry Davidson said:
I have created a macro with a list of RunSQL statements in it that delete
records and apend records to a table, but I dont want the Message "You are
about to delete x rows from table...do you want to continue Yes/No" and Your
about to apend x rows are you sure you want to continue Yes/No" messages to
pop up each time I run the macro. I'm sure this is very simple to do but
could someone please tell me how to disable/suppress the messages?
 
DoCmd.SetWarnings False
..
..
Your statements
..
..
DoCmd.SetWarnings True

--
Kevin3NF

Sick of all that junk filling up your mailbox?
http://spamarrest.com/affl?2967001



Barry Davidson said:
I have created a macro with a list of RunSQL statements in it that delete
records and apend records to a table, but I dont want the Message "You are
about to delete x rows from table...do you want to continue Yes/No" and Your
about to apend x rows are you sure you want to continue Yes/No" messages to
pop up each time I run the macro. I'm sure this is very simple to do but
could someone please tell me how to disable/suppress the messages?
 
Back
Top