Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a mask that looks like 0\.00\.0000 which is used to force serial numbers to look like 1.20.0034. The problem I have is that the dots (.) are not put in the database field. How can I use an input mask and make sure the extra characters are put in the database field? We use Access 2007.

I have tried the input mask 0.00.0000 which does insert the . characters into the field. However when displayed the forms show , because that is the decimal mark in dutch....

share|improve this question
1  
Is that field being saved as text or number into the table? –  CharlieRB Jun 20 '12 at 12:21
    
It is a text field –  Wouter Jun 20 '12 at 12:22
    
I used that input mask in a table for at text field then created a text box input on a form and it saves it as it should. Did you create the input mask in the table or on the form? –  CharlieRB Jun 20 '12 at 12:55
    
Just a thought, I just saw this in the help section of Access referring to the Input Mask properties; "Decimal placeholder and thousand, date, and time separators. (The actual character used depends on the settings in the Regional Settings Properties dialog box in Windows Control Panel)." That could explain why the , replaces the . without the backslash character preceding it. –  CharlieRB Jun 20 '12 at 13:02
    
Which is weird because it is a text field.. Punctuation is not the same as decimal marks obviously. –  Wouter Jun 21 '12 at 15:10

1 Answer 1

add ;0 to the mask to give 0\.00\.0000;0

This tells Access to save the literal characters along with the data

There is a third parameter where you can change which character is used to indicate data entry, so if your mask was 0\.00\.0000;0;# then access would display #.##.#### in the entry field, and store the dots with the text entered.

share|improve this answer
    
When I use 0\.00\.0000;0;# as input mask forms show , as separator when adding a new entry. The literal characters are saved to the database as . though. This is odd. –  Wouter Jun 21 '12 at 15:11
    
I have no idea why that would happen - I'm in US, so don't see any changes if I use slashes or not –  Sean Cheshire Jun 21 '12 at 18:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.