Strange Capital Letter Set-up

JaredNJames

Registered User.
Local time
Today, 13:18
Joined
Jul 7, 2007
Messages
87
Hi, i have a table which has car registrations in.

I need it so that when the user enters data it goes straight to upper case for storage

OR

I need it to be viewed in uppercase when a query is run.

either one will do.

Please dont mention input masks because i cant use them in this instance. The reason being simple: Registrations are usually in the format CT03 AMR, or C132 KIT (Great Bitain Format basically). but there are also some variations such as only three numbers/letters to start. This clearly makes an input mask unsuitable for this procedure.

Any Ideas Welcomed

Jared James
 
In the before update event of the text box you are entering the data in, you can use:

Me.YourTextBoxName = UCase(Me.YourTextBoxName)
 
nice one mate

jared james
 
Where did you put it? Post a screenshot, please.
 
heres the screen shot:
 

Attachments

  • untitled.JPG
    untitled.JPG
    37.4 KB · Views: 156
For one, I would get rid of all spaces in your field and object names as that wreaks havoc on you having to use brackets where you wouldn't need to if you didn't have them.

Sorry, because the text box hasn't updated yet it won't have a value. So, either move the code to the After Update event of the text box or use this:


Me.[Car Registration] = UCase(Me.[Car Registration].Text)
 
i put that second code into my form and everything scr*wed up to put it mildly. all buttons and codes stopped working and i had to get rid of it to get it back!!!

jjames
 
Okay, it seems we might not be communicating properly somehow. Can you post the db for me to look at?
 
Just need one line of code in the KeyPress event of the corresponding TextBox,
the result looks like this in VBA:

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

This way every letter of the alphabet the user presses is immediately capitalized. Works great!
 
i would disallow spaces

otherwise you will get variations of the same reg

AB01ABC
AB 01 ABC
AB01 ABC

etc, all of which will be permitted and different
 

Users who are viewing this thread

Back
Top Bottom