If you want all the characters - including the zeroes - change your input mask
to force it to save the formatted data instead of just what you have typed.
!/L00000000;0
The zero after the semi-colon specifies that Microsoft Access stores the
literal display characters in the table when you enter data. If you use 0 for
this section, all literal display characters (for example, the parentheses in
a phone number input mask) are stored with the value; if you enter 1 or leave
this section blank, only characters typed into the control are stored.
You can use an update query to fix the existing records.
STEP 1: BACKUP your data before attempting the following.
STEP 2: BACKUP your data before attempting the following.
Without a backup you cannot restore the data if this does not work the way you
expect. The update query might look like the following.
UPDATE [YourTable]
SET [YourField} = "L" & Right("00000000" & Mid([YourField],2),8)
WHERE [YourField] Not LIKE "L########" AND [YourField] Like "L*"
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
I have an ID number text field that uses the format 'L00000000'. My table
already has some 3000+ entries 2-7 characters in length (ie: 27340) that need
to be padded to 9 characters (ie: L00027340), the first character 'L' and the
rest '0's.
I used the following Input Mask !/L00000000 and the 'L' appears, but the
zeroes do not, just spaces.
I appreciate any help you may be able to provide.