Prevent 'Dialog Box' from popping up

  • Thread starter Thread starter TonyU
  • Start date Start date
T

TonyU

I have the following code in the main switchboard (in Access 2002):

'Delete imported Expireds records in TaxDB table
DoCmd.RunSQL "DELETE TaxDB.*, TaxDB.LastName FROM TaxDB WHERE
(((TaxDB.LastName) Is Null)); ", -1

This code is executed at start up. When the program is loaded a dialog box
pops up, requesting to verify that I want to have n records deleted. Is
there a way to keep the dialog box from popping up?

Thanks,
Tony
 
Tony,

Use the DoCmd.SetWarnings Method.

Before your code add
DoCmd.SetWarnings False
and after it add
DoCmd.SetWarnings True

Be sure to reset it to true or you won't get other message that you may be
wanting!

Daniel P
 
Thanks Daniel


Daniel said:
Tony,

Use the DoCmd.SetWarnings Method.

Before your code add
DoCmd.SetWarnings False
and after it add
DoCmd.SetWarnings True

Be sure to reset it to true or you won't get other message that you may be
wanting!

Daniel P
 

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

Back
Top