Discussion Locked

Access 97 Input Mask

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I have a field in an Access 97 database whose inputmask is defined as:
00\->LLL\-0000\-C;0;_
The rightmost dash always appears. What I'm trying to do is not have the dash if the C is a space.
Is there a way to correct the inputmask to accomplish this?
TIA!

4 replies

by dsa

You cannot have your cake and eat it too. You either remove the dash and replace with space or leave the mask alone and live with the result.

by itmanager

Try this:
Private Sub Form_Current()
If IsNull(Me!ControlName) then
Me!ControlName.InputMask = "00\->LLL\-0000\-C;0;_"
Else
If Len(Me!ControlName) > 9 Then
Me!ControlName.InputMask = "00\->LLL\-0000\-C;0;_"
Else
Me!ControlName.InputMask = "00\->LLL\-0000C;0;_"
End If
End If

* I assumed the length of any values would be 9 or 10
* By Leaving the C you can always edit the field and add that last character. After Form_Current fires the Input mask will display the "-" again.

This discussion is closed to new replies.