Hi all
I have textbox on a form that is numeric data type. I am trying to have data validation instead of the ms Access error message for this field. I have tried everything, even adding a new textbox. I have deleted format "general number", default value, and for some reason cannot figure this out. I have tried code in before update, after update and on change events of the textbox, and the precanned MS Access error message shows all the time first.
Here is the code I have in the before update event of textbox:
Any help is greatly appreciated.
Raven
I have textbox on a form that is numeric data type. I am trying to have data validation instead of the ms Access error message for this field. I have tried everything, even adding a new textbox. I have deleted format "general number", default value, and for some reason cannot figure this out. I have tried code in before update, after update and on change events of the textbox, and the precanned MS Access error message shows all the time first.
Here is the code I have in the before update event of textbox:
Code:
Dim ADL As String
ADL = vbNewLine & vbNewLine
If Not IsNumeric(Me.NCQty) Then
msg = "QUANTITY MUST BE NUMBER VALUE!!!" & ADL & _
"YOU MUST ENTER A NUMERIC VALUE NOT TEXT" & ADL & _
"PLEASE REENTER A NUMERIC VALUE"
Style = vbInformation + vbOKOnly
Title = "QUANTITY MUST BE NUMBER VALUE!"
MsgBox msg, Style, Title
Response = acDataErrContinue
Cancel = True
Me.NCQty.Undo
End If
Any help is greatly appreciated.
Raven