Stupid Question

Silverblood

Registered User.
Local time
Today, 12:53
Joined
Aug 4, 2005
Messages
39
Here's a stupid question... how can u make a field in a form so that the text in it is allways in capitals, it's for adresses and i need the city and the zipcode to be in capitals, any ideas?

Thanks on forehand

SilverBlood
 
If you right click on the form field in question then select the format tab and then format and place the following in the format field >
All data appearing in that fild will now be in capitals
 
It did the trick, didn't know it was that easy. thanks a lot



Kind Regards


SilverBlood
 
Wrong. That method will only make the value appear to be capitalized but the value that is stored in the table will still be in what ever case the user keyed the value in.

To do what you want you will have to convert the keyed value using the AfterUpdate event of the field in the form. Like this...

Code:
Private Sub YourTextBox_AfterUpdate()
On Error GoTo Err_YourTextBox_AfterUpdate

    YourTextBox = Trim(YourTextBox)
    YourTextBox = StrConv(YourTextBox, vbUpperCase)

Exit_YourTextBox_AfterUpdate:
    Exit Sub

Err_YourTextBox_AfterUpdate:
    ErrorMsg Me.Name, "YourTextBox_AfterUpdate", Err.Number, Err.Description
    Resume Exit_YourTextBox_AfterUpdate

End Sub
 

Users who are viewing this thread

Back
Top Bottom