The following code does not work. I am using Access 2007 Fe to SQL Server 2005 backend. What am I doing wrong? The message boxes don't work and it allows quantities to be entered greater than the quantiy on hand.
Private Sub Qty_AfterUpdate()
If Me.Qty > [dbo_AssetDescriptionQtyVWDetail].Form![QtyonHand] Then
MsgBox "Insufficient Qty on Hand"
Me.Qty.SetFocus
Else
If Me.Qty = 0 Then
MsgBox "Qty Can Not Equal Zero"
Me.Qty.SetFocus
Else
Me.TotalAmount.SetFocus
End If
End If
End Sub
Private Sub Qty_AfterUpdate()
If Me.Qty > [dbo_AssetDescriptionQtyVWDetail].Form![QtyonHand] Then
MsgBox "Insufficient Qty on Hand"
Me.Qty.SetFocus
Else
If Me.Qty = 0 Then
MsgBox "Qty Can Not Equal Zero"
Me.Qty.SetFocus
Else
Me.TotalAmount.SetFocus
End If
End If
End Sub