Hi,
In access leading zero's are omitted, so 025 will be 25 if the field data type is a number. To keep leading zero's the field data type is text; in this case 025 will be 025.
I have a function fnValidation that checks to have only one dot ( . ) in the field. so 23.6 is accepted but 23..6 or 23.6.7 are not accepted as data entries.
I also needs to check that no letters or other characters are included. so values such as 34h or 34# or (34 % d5) are not accepted as data entries.
In other words: data for this text box should compose only of digits from 0-9 and one dot (.)
How would my BeforeUpdate event for that text box be updated?
The validation fnValidation has the following code:
Code:
Private Function fnValidation(txt As String) As Boolean
If InStr(1, txt, ".") > 0 And InStr(InStr(1, txt, ".") + 1, txt, ".") > 0 Then
MsgBox "Only one full stop (.) permitted", vbCritical, "Invalid Entry..."
fnValidation = False
Exit Function
Else
fnValidation = True
End If
End Function
The BeforeUpdate events is:
Code:
On Error GoTo ProcError
If fnValidation(Me.txtCallNumber) = False Then
cancel = True
End If
Sincerely yours
Khalil