Change licence plate letters to upper case

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've read through some of the post here on changing to upper case, and I
cannot figure out how to apply it....

If the user enters a licence plate of 1553hs, I want to change it to 1553HS.
This would also apply to avd123, being changed to AVD123.

Would a For - Next loop be required to test each character to determine if
it is a letter or number, then change lower case letters to upper case and
rebuild the string?

Thanks in advance
 
When are you wanting to change to UCase?

If it's as the user types a character into the field then trap the KeyPress
event

Private Sub Text0_KeyPress(KeyAscii As Integer)
KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub

If you want to run on data that's already stored then run an update query
UPDATE Table1 SET Table1.LicenceNo = UCase([LicenceNo]);

HTH, Graeme
 
How about the UCase function?

You can use something like this:

Dim LowerCase, UpperCase
LowerCase = "1553hs" ' String to convert.
UpperCase = UCase(LowerCase) ' Returns "1553HS".
 
To correct existing entries, create an update query...

UPDATE SomeTable SET SomeTable.License = UCase([License]);



Rick B
 
Wow, talk about many different way to do one thing...


Thanks everyone, I'm sure that all your suggestions will come in handy at
some point.

Cheers
 
You've probably already gathered this from the previous responses, Paul, but
in case any confirmation is needed, you don't have to check whether the
character is a number, letter etc., you can just go ahead and call UCase on
the entire content of the text box, UCase doesn't raise any error if the
field contains numbers, punctuation marks or symbols, nor does it change
them, it just silently ignores them.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Yes I figured that as you said....and Thanks.

Brendan Reynolds said:
You've probably already gathered this from the previous responses, Paul, but
in case any confirmation is needed, you don't have to check whether the
character is a number, letter etc., you can just go ahead and call UCase on
the entire content of the text box, UCase doesn't raise any error if the
field contains numbers, punctuation marks or symbols, nor does it change
them, it just silently ignores them.

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Paul, are you also aware that you can use > within the Input Mask of the
field on the form. This would convert it to upper case as they enter it,
instead of having to worry about upper caseing it later.

Bruce.
****************
 
Back
Top