By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,841 Members | 1,816 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,841 IT Pros & Developers. It's quick & easy.

Table Delete Warnings

100+
P: 132
How do I supress the warning message one gets when running a Make table Query?? Access wants the user to confirm the deletion of a table before it proceeds....can U turn this function off??
Aug 30 '07 #1
Share this Question
Share on Google+
8 Replies


Scott Price
Expert 100+
P: 1,384
DoCmd.SetWarnings False works in VBA mode, but you'll have to call the query from vba to get that to work... And don't forget to turn them back on again later by changing the False to True :-)

Regards,
Scott
Aug 30 '07 #2

ADezii
Expert 5K+
P: 8,669
How do I supress the warning message one gets when running a Make table Query?? Access wants the user to confirm the deletion of a table before it proceeds....can U turn this function off??
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False          'turn Warnings OFF
  2.   DoCmd.OpenQuery "qryMakeTable", acViewNormal, acEdit
  3. DoCmd.SetWarnings True            'turn Warnings ON again
Aug 30 '07 #3

ADezii
Expert 5K+
P: 8,669
DoCmd.SetWarnings False works in VBA mode, but you'll have to call the query from vba to get that to work... And don't forget to turn them back on again later by changing the False to True :-)

Regards,
Scott
Sorry Scott, must have been working on this one at exactly the same time.
Aug 30 '07 #4

Scott Price
Expert 100+
P: 1,384
Sorry Scott, must have been working on this one at exactly the same time.

Never a problem! The exact method may be more helpful than just a point in the right direction :-)

Regards,
Scott
Aug 30 '07 #5

100+
P: 132
Never a problem! The exact method may be more helpful than just a point in the right direction :-)

Regards,
Scott

Thanks, Guys!! Worked like a charm!!
Sep 4 '07 #6

ADezii
Expert 5K+
P: 8,669
Thanks, Guys!! Worked like a charm!!
We are always glad to be of service.
Sep 4 '07 #7

Expert 100+
P: 344
Expand|Select|Wrap|Line Numbers
  1. DoCmd.SetWarnings False          'turn Warnings OFF
  2.   DoCmd.OpenQuery "qryMakeTable", acViewNormal, acEdit
  3. DoCmd.SetWarnings True            'turn Warnings ON again

Can I make a late addition here. If you have error handling code in your routines (and of course, everyone does), make sure that you turn warnings back on in the error handling.

I lost a lot of data once, where a delete had failed, error handling picked up the failure, but left the system with warnings set off.
Sep 4 '07 #8

ADezii
Expert 5K+
P: 8,669
Can I make a late addition here. If you have error handling code in your routines (and of course, everyone does), make sure that you turn warnings back on in the error handling.

I lost a lot of data once, where a delete had failed, error handling picked up the failure, but left the system with warnings set off.
Excellant point and one to surely remember! We take Error Handling for granted, usually because of the increased length of the code segments that it would entail. Certain items should always be turned ON/OFF in Error Handlers such as rolling back Transactions, turning the Hourglass back to its Normal state, closing Recordsets, etc. Thanks again for bring this point to our attention, Lysander.
Sep 4 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.