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!

switch off Action Query - confirm via VBA 2

Status
Not open for further replies.

ShaneBrennan

Programmer
May 19, 1999
198
GB
Does anyone know how to switch off the the Confirm Action Queries.

The one available by

Tools menu -----> options
Edit/find Tab ?

Thanks
Shane Brennan
Shane.Brennan@tcat.ac.uk

 
DoCmd.SetWarnings False
'Run Action Query
DoCmd.SetWarnings True

Make sure you turn them back on in your code because this is a global setting and you'll lose ALL the confirmations (IE: do you want to delete this record) etc...

HTH Joe Miller
joe.miller@flotech.net
 
Is there a safer way? I want to turn the Confirm action querys off at the start, then forget about it.

I still want the confirmation of delete records though :)

Shane Brennan
Shane.Brennan@tcat.ac.uk

 
SOLVED IT :)

Found a lovely command called .SetOption :)

Looks quite powerful and extremely useful - where was my help file earlier :)

Anyways here are two procedures for switching between confirm and un-confirm :)

Sub SetConfirmOff()

Application.SetOption "Confirm Action Queries", False

End Sub

Sub SetConfirmOn()

Application.SetOption "Confirm Action Queries", True

End Sub

Hope they prove useful to someone else

Shane


Shane Brennan
Shane.Brennan@tcat.ac.uk

 
Good find Shane, and hence the reason I spend time in these here forums. To get proved wrong and learn something new.

Joe Miller
joe.miller@flotech.net
 
Your welcome Joe :)

I know, I come here quite often to get my knowledge of all that is Access :)

Shane Brennan

'-----------------------
' ICQ#125948839
' Emails: sab149@icqmail.com
' shanebrennan@postmaster.co.uk
' Personal ICQ Comms. Centre: wwp.icq.com/125948839
'
' Personal WebPage:
 
Here, Shane. Have a star. That particular bit of code will come in handy in some of my databases. I've been telling my users how to turn off the confirm in Access, but I never thought I could do it for them. Maq B-)
<insert witty signature here>
 
Thank you SHANE!

You made my day. This was the answer I needed.

I appreciate your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top