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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't understand how to use nowarn()

Status
Not open for further replies.

BullHalseyUSN

Technical User
Aug 28, 2003
72
US
Greetings, Experts:

I am afraid this is going to be me parading my ignorance. However, I could not find a good description of how one uses nowarn().

I have a command button that launches an update query. I must turn the warnings and notifications off, as my users are reporting these as "bugs!" and asking if they should press "ok" or "cancel" about 356X a day! Aargh.

In relevant part, I have

Private Sub Command73_Click()
On Error GoTo Err_Command73_Click

Dim stDocName As String

stDocName = "Query2"
DoCmd.OpenQuery stDocName, acNormal, acEdit

etc.

How do I make Query2 shut up already about updating the goshdarn records! :) Don't understand this nowarn function.

Many thanks!

BH
 
Use:

Private Sub Command73_Click()
On Error GoTo Err_Command73_Click

Dim stDocName As String

DoCmd.SetWarnings False
stDocName = "Query2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
....

DoCmd.SetWarnings True

****************************
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Robert -

Thank you for the guidance. However, this:

Dim stDocName As String
DoCmd.SetWarnings False
stDocName = "Query2"
DoCmd.OpenQuery stDocName, acNormal, acEdit
DoCmd.SetWarnings True

Doesn't appear to suppress the "you are about to update..." warnings.

Thoughts, please?

Tks.
 
Are you sure???

I gathered from your initial post there were more queries being run.....if you have only surrounded the one, you will be seeing the message for others.

Place the

Docmd.setwarnings false

just before your first query and the

DoCmd.setwarnings true

just after your last....

****************************
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top