Macro RunSQL Statement Message Suppression

B

Barry Davidson

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
 
C

Cheryl Fischer

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?
 
K

Kevin3NF

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top