Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trapping Input Mask Errors

Status
Not open for further replies.

ChemistZ

Programmer
Oct 30, 2001
70
US
This is yet another post that is related to my others. In my claim form, when a user goes to a new record and then hits the close button - at first they were being hit with a message about something being required. I fixed that but it occurred to me that if they type just one or two things and then want out that I better prepare for that. The first field has an input mask of LL set on it for two required letters. So, now if I enter one letter and then hit the close button I get the dreaded input mask error. I tried taking the input mask off in properties and putting in my close button code

If Me.Dirty And IsNull(Me!CLAIM_TYPE_CODE) Then
MsgBox "You can not leave CLAIM TYPE CODE blank. It is a required field. Please enter the correct CLAIM TYPE CODE.", , "Service of Process Error"
Me!CLAIM_TYPE_CODE.SetFocus
ElseIf CLAIM_TYPE_CODE.InputMask <> &quot;LL&quot; Then
MsgBox &quot;The Claim Type Code Field Requires Two Letters Be Entered, such as WC. Please do so now.&quot;, , &quot;Service of Process Error Message&quot;
CLAIM_TYPE_CODE.SetFocus
Else
DoCmd.Close
End If

However, now even if I type two letters I still get the message. Help!
 
try
If Me.Dirty And Me!CLAIM_TYPE_CODE= &quot;&quot; Then
MsgBox

not sure but what the HEY
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top