If I understand you correctly, the InputMask in not needed, instead use a
Format of yyyy"/"mm
It should automatically change to yyy\/mm
Goto the Events tab of the form and choose [Event Proceedure] as the setting
for the OnError event. Click the builder button beside this and put in the
following...
Select Case DataErr
Case 2113 '----The value you entered isn't valid for this field...error
If Screen.ActiveControl = Me!Text0 Then
MsgBox "Please enter only valid Date information in the form of
yyyy/mm.", vbOKOnly, "Invalid Date"
Response = acDataErrContinue
End If
Case Else
Response = acDataErrDisplay
End Select
This should allow you to trap most errors and determine what control
triggered it. Add a new CASE section for each form error you wish to trap,
and use Screen.ActiveControl to tailor the process according to the control
that caused it.
Mike Storr
PS - I based this assuming you are working in A97, but I'm pretty sure this
should still apply in 2K
"Jeremy" <jc*******@rmhp.org> wrote in message
news:e9**************************@posting.google.c om...
I am creating a form that a person enters a date span in yyyymm form.
I want a box to pop up that tells the user "Please enter date in
correct format" if the user has entered the data incorrect. I have
entered the input mask and the auto tab order. I have done this
before, but I cannot remember the syntax for the code to pop up the
error box. Please help.