Have a capital letter automatically entered

  • Thread starter Thread starter Alex Martinez
  • Start date Start date
A

Alex Martinez

Hello,

I have a text box in my form that the user inputs a policy number for
example "P128945" the problem is the user input the policy number as
"p128945" How can I have the first prefix letter be capitalize
automatically when the user inputs the policy number? Any tips will be
appreciated. Thank you in advance.
 
Hello,

I have a text box in my form that the user inputs a policy number for
example "P128945" the problem is the user input the policy number as
"p128945" How can I have the first prefix letter be capitalize
automatically when the user inputs the policy number? Any tips will be
appreciated. Thank you in advance.

Set the input mask property to
 
Fred

All that will do is give the user the *option* to input a letter or digit.
It doesn't do anything to capitalise the characters.

M
 
Hi Alex

While you could use an input mask, these sometimes make the user interface
behave in unpredictable and annoying ways.

I prefer to use the textbox's AfterUpdate event:

Private Sub MyTextBox_AfterUpdate()
MyTextBox = UCase( MyTextBox )
End Sub
 
The > sign will cause capital letters. It may have looked like the sign
that goes in front of each line of text in the previous postings to the
thread.

Someone said:
Fred

All that will do is give the user the *option* to input a letter or digit.
It doesn't do anything to capitalise the characters.

M
 
The point *is* to cause a capital letter.

BruceM said:
The > sign will cause capital letters. It may have looked like the sign
that goes in front of each line of text in the previous postings to the
thread.
 
Someone said:
The point *is* to cause a capital letter.

Which the > sign accomplishes, at least in my experience. If you use >aaaaa
as the input mask, is it possible to produce anything other than a capital
letter (or a number)?
 
The point *is* to cause a capital letter.

You really should try it. Write >aaaaaaa as the input mask and try to
enter a lower case letter. You can't.
Actually, if it was my database, I would use the AfteUpdate event as
suggested by Graham Mandeno.
 
You really should try it. Write >aaaaaaa as the input mask and try to
enter a lower case letter. You can't.
Actually, if it was my database, I would use the AfteUpdate event as
suggested by Graham Mandeno.

<SNIP>

To be honest, either works, but 'a' indicates an optional entry. Presuming
it's not optional, then you'd need 'A'. I offered '0' as the input mask,
because in the example the OP gave after the initial letter, the characters
following it were all numeric. This would have ensured no accidental
letters were entered.

I gave >L to start with because the OP needed to ensure the first character
*had* to be an upper case letter (i.e. not optional).

Anyway, let's not flog a dead horse :)
 
Someone said:
<SNIP>

To be honest, either works, but 'a' indicates an optional entry.
Presuming it's not optional, then you'd need 'A'. I offered '0' as the
input mask, because in the example the OP gave after the initial letter,
the characters following it were all numeric. This would have ensured no
accidental letters were entered.

I gave >L to start with because the OP needed to ensure the first
character *had* to be an upper case letter (i.e. not optional).

Anyway, let's not flog a dead horse :)

I have an apology to make - I didn't see the > on your initial post.
Sorry!!
 

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

Back
Top