Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically selecting Yes/No/Cancel when running a query via VBA

Status
Not open for further replies.

dax1

MIS
Nov 18, 2002
8
0
0
CA
Hello,

I am running an make table query via VBA. My problem is that while the query is running a message will pop up (ACCESS Dialog Box) stating

1. I am about to delete an existing table (Then you have a choice of answer Yes/No or Help)
2. Then it states that XX number of lines will be written to the new table (again Yes/No).

As I am very new to VBA, I would like to know,

How can a sequence a code such that I can answer automatically when these dialog boxes appear. I know through ACCESS I can disactivate these confirmations (dialog boxes) but I would like to know how I can adjust my responses since it is possible in the 1st popup it will require a YES and in the 2nd a No.

Thank you,

DAX1
 
You can turn off the warnings by using the following:

DoCmd.SetWarnings False

If you want to turn them back on after all queries have been run type:

DoCmd.SetWarnings True

Phil
 
Woops... should have read the last sentence more carefully. I'll look at it and let you know if I come up with anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top