Paul Cooke
Registered User.
- Local time
- Today, 23:32
- Joined
- Oct 12, 2001
- Messages
- 288
Hi Guys could someone advise me on this please. I keep getting the error message on some date / time controls even though I have code behind them to stop this...
This code works fine if for example in the date field the users enters just "12/01" (Case "txtTreatmentDate") telling the user to use 6 digits but if I entered a value that is wrong for example 32/12/10 the default error message comes up 'The value you entered is valid for this field'
I thought I had handled this with acdataerrcontinue?
Any help or advice will be gratefully recieved - many thanks
ps the input masks are
Code:
Const INPUTMASK_VIOLATION = 2279 Or 2113
Dim msg As String
If DataErr = INPUTMASK_VIOLATION Then
Select Case Screen.ActiveControl.Name
Case "txtTreatmentDate"
Beep
MsgBox "Please enter 6 digits for dates e.g. 241270 (ddmmyy)." & vbCrLf & "" & vbCrLf & _
"Please click ok to continue.", vbInformation, "Incorrect Data Entered"
Case "txtTreatmentTime"
Beep
MsgBox "Please enter 4 digits for time e.g. 2359 (HHMM)." & vbCrLf & "" & vbCrLf & _
"Please click ok to continue.", vbInformation, "Incorrect Data Entered"
Case Else
msg = "Incorrect data has been entered in a field, please check and correct data"
msg = msg & Screen.ActiveControl.Name & "!"
End Select
response = acDataErrContinue
End If
This code works fine if for example in the date field the users enters just "12/01" (Case "txtTreatmentDate") telling the user to use 6 digits but if I entered a value that is wrong for example 32/12/10 the default error message comes up 'The value you entered is valid for this field'
I thought I had handled this with acdataerrcontinue?
Any help or advice will be gratefully recieved - many thanks
ps the input masks are
Code:
1. date - 00/00/00;0;_
2. time - 00:00;0;_