TSIsolutions
MIS
hey guys/gals
I must've used this code 1000 times before and I dont understand where the problem is. Can anyone figure it out?
I have an unbound textbox and I want to make sure that the number is positive. I assign a 1 as default and would like it to revert to that if the number is negative. I really can't see what the problem is.
Private Sub txtSerialMax_BeforeUpdate(Cancel As Integer)
If Me.txtSerialMax <= 0 Then
MsgBox "Invalid Serial No."
Me.txtSerialMax.Undo
Cancel = True
Exit Sub
End If
End Sub
I don't know if it's important but the form is also unbound, popup and opened in Dialog mode.
Help please.
I must've used this code 1000 times before and I dont understand where the problem is. Can anyone figure it out?
I have an unbound textbox and I want to make sure that the number is positive. I assign a 1 as default and would like it to revert to that if the number is negative. I really can't see what the problem is.
Private Sub txtSerialMax_BeforeUpdate(Cancel As Integer)
If Me.txtSerialMax <= 0 Then
MsgBox "Invalid Serial No."
Me.txtSerialMax.Undo
Cancel = True
Exit Sub
End If
End Sub
I don't know if it's important but the form is also unbound, popup and opened in Dialog mode.
Help please.