how do i set an input mask in access 2000 to allow hyphenated nam.

G

Guest

trying to use a field to input surname. I want to use an input mask that will
allow hyphenated surnames and capitalise the first character of all surnames.
 
T

tina

you can allow any character or a space, entry optional, by using the capital
letter C in the mask, as

CCCCCCCCCC

to allow a 10 character/space entry, for example. (you can find out all
about input masks by looking up the Input Mask Property topic in Access
Help; the easy way to get to the topic is by opening your table or form in
design view, placing your cursor on the InputMask property's line in any
field or control, and pressing F1.) generally speaking, i'd say an input
mask in this situation is useless. if you want to limit the number of
characters that may be entered, suggest you limit the Field Size of the
underlying text field at the table level - to 30, for instance.

AFAIK, you can't force only the first character to be capitalized by using
an input mask. you need to do it with VBA code, as

Private Sub MyControl_AfterUpdate()

Me!MyControl = Nz(StrConv(Me!MyControl, vbProperCase), Null)

End Sub

but that solution is not perfect. the name "Smith-Jones" will be forced to
"Smith-jones"; likewise "McGregor" will be forced to "Mcgregor", etc.

hth


"Graham (The Jock) Thomson."
trying to use a field to input surname. I want to use an input mask that will
allow hyphenated surnames and capitalise the first character of all
surnames.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top