suppressing dialog boxes - on append SQL

battenberg

Burning candles both ends
Local time
Today, 21:59
Joined
Sep 25, 2006
Messages
118
I have just created an append SQL string that adds a new record,

Code:
sql = "INSERT INTO tblAncilleries ( ProductID, PartNumber, ProductDescription ) VALUES ( " & strProductID & "," & strPartNumber & ", " & strDescription & " );"

DoCmd.RunSQL sql

How do I suppres the dialog box - see jpg?

Thanks
 

Attachments

  • appendrecord.JPG
    appendrecord.JPG
    14.7 KB · Views: 107
thankyou for the hint:

syntax is : DoCmd.SetWarnings (off)

thanks again...
 
Code:
DoCmd.SetWarnings(False)

...put your other code here

DoCmd.SetWarnings(True)
I would also put the DoCmd.SetWarnings(True) as the very first thing in your error handler for the event, as if you don't you may find yourself without any warnings at all if something fails and it never gets to the DoCmd.SetWarnings(True) in the main code. And, that is bad.
 
boblarson said:
Code:
DoCmd.SetWarnings(False)

...put your other code here

DoCmd.SetWarnings(True)
I would also put the DoCmd.SetWarnings(True) as the very first thing in your error handler for the event, as if you don't you may find yourself without any warnings at all if something fails and it never gets to the DoCmd.SetWarnings(True) in the main code. And, that is bad.

For sure - Turn 'em back on - :)
 

Users who are viewing this thread

Back
Top Bottom