Access 2010 Pattern Match

Hi Experts,

I have a field on a form that is Text 7 characters.  The value that must be entered has a pattern of ###.#:1.  e.g. 098.3:1.

The right 2 characters will always be ':1' as this is a ratio.

How do I specify the Pattern Matching (on the form and also using VBA in an Event) to ensure that the left 5 characters are always entered and in the specified format of 3 digits a decimal point and one digit with the right two characters always ':1'.

Thanks,
Bob C.
Bob CollisonSystem ArchitectAsked:
Who is Participating?
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
hi Bob,

You can specify an InputMask for the control (you could also put this in the table design for the field -- but that is not necessary if data will be entered and changed using a form).  This one:
000.0.\1;0;_

specifies 3 numbers then dot then one number then dot then a literal character of "1"
; separates the parts
;0 means that the symbols are stored in the data (the dots and ending "1") -- "0" is the second part of the InputMask
;_ means that underscore will be the place-holder character  -- "_" is the third part of the InputMask

here is a reference link:

TextBox.InputMask Property
https://msdn.microsoft.com/en-us/VBA/Access-VBA/articles/textbox-inputmask-property-access


have an awesome day,
crystal
1
 
Bob CollisonSystem ArchitectAuthor Commented:
Hi Crystal,

Thanks for the information.  It is what I was looking for.

Thanks,
Bob C.
0
 
crystal (strive4peace) - Microsoft MVP, AccessRemote Training and ProgrammingCommented:
you're welcome, Bob ~ happy to help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.