I am getting error, RUN TIME ERROR 13, type mismatch
I have 2 tables. products and tblUpdates. My form frmProductUpdat e is
assosiated with tblUpdates.I am trying to update quantity on hand. can
any one help plzz
Private Sub Quantity_AfterU pdate()
Dim TotalQty As Integer
TotalQty = DLookup("[Quantity]", "[Products]", "[ProductID]=" &
Forms![frmProductUpdat e]![ProductID])
If (TotalQty - [QtyOnHand]) < 12 Then
MsgBox "Inventory Below 0. Quantity Issued is To High!"
Cancel = True
Exit Sub
End If
TotalQty = TotalQty - [QtyOnHand]
DoCmd.SetWarnin gs False
DoCmd.RunSQL "UPDATE [Products] SET " & _
"[Products].[QtyOnHand] = " & TotalQty & _
"WHERE ((([Products].[ProductID])='" & [ProductID] & "'));"
DoCmd.SetWarnin gs True
End Sub
*** Sent via Developersdex http://www.developersdex.com ***
I have 2 tables. products and tblUpdates. My form frmProductUpdat e is
assosiated with tblUpdates.I am trying to update quantity on hand. can
any one help plzz
Private Sub Quantity_AfterU pdate()
Dim TotalQty As Integer
TotalQty = DLookup("[Quantity]", "[Products]", "[ProductID]=" &
Forms![frmProductUpdat e]![ProductID])
If (TotalQty - [QtyOnHand]) < 12 Then
MsgBox "Inventory Below 0. Quantity Issued is To High!"
Cancel = True
Exit Sub
End If
TotalQty = TotalQty - [QtyOnHand]
DoCmd.SetWarnin gs False
DoCmd.RunSQL "UPDATE [Products] SET " & _
"[Products].[QtyOnHand] = " & TotalQty & _
"WHERE ((([Products].[ProductID])='" & [ProductID] & "'));"
DoCmd.SetWarnin gs True
End Sub
*** Sent via Developersdex http://www.developersdex.com ***
Comment