Input Mask Issue

bakkouz

Registered User.
Local time
Today, 18:09
Joined
Jan 16, 2011
Messages
48
Hiya,
I have a question regarding input masks, I'm currently used an input mask on a control on my form to store the value in the form of ( DL00-0000 ) eg: DL10-1874 or DL11-2547
-The DL part is constant, ie: always = DL
-The two numbers following DL can only be digits from 1 to 9, ie : 11 or 88 or 63
-The Minus sign is constant, ie: always = (-) (a representation of divider obviously not a mathematical minus)
-And Finally, the last four digits can only be digits from 1 to 9, ie: 6587 or 1265

At first I used this form of input mask: "DL"00"-"0000
but this only stored the numbers entered into a form without the DL or the Minus sign, eg: 555555

So then I used this form of input Mask: LL00\-0000 and set the default value of the control to "DL00-0000" this managed to store the DL but not the Minus sign, eg: DL555555

I'm currently stumped. I don't know what to do, should I use both Input mask and default value, or can an input mask alone do the trick, and if so, how should it look like?

To sum up: I need the user to enter 6 digits in the control, ie: (689774), but to be actually stored in the table as: DL68-9774 for example.

Help is much appreciated.
Thank you
 
If those letters are constant why store them? That's not good practice.

What you can do is present that number in the form that you want using:
Code:
="DL" & Left([ID], 2) & "-" & Mid([ID], 3)
 
vbaInet
Yes, I agree, it is not good practice at all, but that's what the boss wants, sigh.
he wants to see the data in the table as it appears in the form. its pointless, I know, but well, some men you just can't reach.
 
Just scare him by saying you've spoken to some experts and they said it will corrupt the database. :D

Well, if you want to be able to save it, the datatype has to be changed from Number to Text, and you need to UPDATE ALL the linked records. That might scare him.
 

Users who are viewing this thread

Back
Top Bottom