I have an unbound textbox on my form, used to enter an amount of money a customer paid cash.
I want to check the entry in this box; if the field is blank or 0, it would show a msgbox that the entry is incorrect.
I used something like the code below :
Private Sub Cash_LostFocus()
If Cash.Value < 1 Then
If MsgBox("msg here ??", vbYesNo + vbQuestion , "title here" = vbNo Then
cash.setfocus
End If
End Sub
When the value is less than 1, it indeed gives the messagebox, but it always jumps to the next control.
I also tried docmd.gotocontrol cash
but that also doesn't work.
Anyone ?
Peter
I want to check the entry in this box; if the field is blank or 0, it would show a msgbox that the entry is incorrect.
I used something like the code below :
Private Sub Cash_LostFocus()
If Cash.Value < 1 Then
If MsgBox("msg here ??", vbYesNo + vbQuestion , "title here" = vbNo Then
cash.setfocus
End If
End Sub
When the value is less than 1, it indeed gives the messagebox, but it always jumps to the next control.
I also tried docmd.gotocontrol cash
but that also doesn't work.
Anyone ?
Peter