I am trying to provided an error check compent to my form where it checks to see if a value in the intWantQty is greater than 1 if so it would prompt the user of a possible error. However when I test the code below it prompts for and value enter even if the intWantQty is 0. Any ideas?
Thanks
-Pat
Private Sub intTradeUpdate_AfterUpdate()
Dim LResponse As Integer
LResponse = MsgBox("You are adding a card to the trade inventory," & Chr(13) & Chr(10) & "however it appears that you need this card to help complete complete this set" & Chr(13) & Chr(10) & "Do you wish to continue?", vbYesNo, "Continue")
If LResponse = vbYes Then
If intWantQty.Value >= 1 Then
strSQL = "Update tblCards set intTradeQty=intTradeQty+" & Nz(Me.intTradeUpdate, 0) & " where pkCardID= '" & Me.pkCardID & "'"
DoCmd.SetWarnings False
Debug.Print strSQL
DoCmd.RunSQL strSQL
strSQL = "Update tblCards set intTradeQty=intTradeQty+" & Nz(holdTIUpdqty, 0) & " where pkCardID= '" & Me.pkCardID & "'"
DoCmd.SetWarnings False
Debug.Print strSQL
DoCmd.RunSQL strSQL
Me.intWantQty.Requery
Me.intHaveQty.Requery
Me.intTradeQty.Requery
Me.intTradeUpdate.Value = ""
Else
Me.intTradeUpdate.Value = ""
Me.intWantQty.Requery
Me.intHaveQty.Requery
Me.intTradeQty.Requery
Me.intWantUpdate.SetFocus
End If
End If
Thanks
-Pat
Private Sub intTradeUpdate_AfterUpdate()
Dim LResponse As Integer
LResponse = MsgBox("You are adding a card to the trade inventory," & Chr(13) & Chr(10) & "however it appears that you need this card to help complete complete this set" & Chr(13) & Chr(10) & "Do you wish to continue?", vbYesNo, "Continue")
If LResponse = vbYes Then
If intWantQty.Value >= 1 Then
strSQL = "Update tblCards set intTradeQty=intTradeQty+" & Nz(Me.intTradeUpdate, 0) & " where pkCardID= '" & Me.pkCardID & "'"
DoCmd.SetWarnings False
Debug.Print strSQL
DoCmd.RunSQL strSQL
strSQL = "Update tblCards set intTradeQty=intTradeQty+" & Nz(holdTIUpdqty, 0) & " where pkCardID= '" & Me.pkCardID & "'"
DoCmd.SetWarnings False
Debug.Print strSQL
DoCmd.RunSQL strSQL
Me.intWantQty.Requery
Me.intHaveQty.Requery
Me.intTradeQty.Requery
Me.intTradeUpdate.Value = ""
Else
Me.intTradeUpdate.Value = ""
Me.intWantQty.Requery
Me.intHaveQty.Requery
Me.intTradeQty.Requery
Me.intWantUpdate.SetFocus
End If
End If