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

Elimination of confirmation message in a RunSQL "update"

Status
Not open for further replies.

tigreeuropeo

IS-IT--Management
Oct 2, 2001
30
ES
I am developing a very simple application, that manages products and orders.
When entering one line of the order for a client, I have to update the stock like this:

Private Sub Form_AfterInsert()
strsql = "update stock set art_quant = art_quant - " & _
Str(Me!LinAlb_Cant) & _
" where art_cod_referencia = " & _
"'" & Me!LinAlb_Art_Ref & "'"
DoCmd.RunSQL (strsql)
End Sub

When executing the RunSQL, it appears a confirmation message box that I need to eliminate.
Do you know how to do it?.
 
dear tigreeuropeo,

Private Sub Form_AfterInsert()
docmd.SetWarnings off

strsql = "update stock set art_quant = art_quant - " & _
Str(Me!LinAlb_Cant) & _
" where art_cod_referencia = " & _
"'" & Me!LinAlb_Art_Ref & "'"
DoCmd.RunSQL (strsql)
docmd.SetWarnings on

'and never forget to set them on again as it kills all warnings (runtimeerrorwarning and so on)
End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top