Easy format Q

chef_tim

Registered User.
Local time
Today, 17:04
Joined
Dec 16, 2004
Messages
77
Hi All, can some one show me the proper expression to make capital letters. I'll be using it on form controls. I'll just be using the control properties, format..... I think. The UCase I put in there is getting broke up with front slashes (/) Thanks, Tim
 
You can convert the keyed data into uppercase. I use this in the AfterUpdate event of a text box named "tbFirstName". It will convert the data [which is saved to the table] to the upper case after the user has moved the focus to another object [button, text box, etc].

Code:
Private Sub tbFirstName_AfterUpdate()
On Error GoTo Err_tbFirstName_AfterUpdate
    
    tbFirstName = Trim(tbFirstName)
    tbFirstName = StrConv(tbFirstName, vbUpperCase)
    'tbFirstName = StrConv(tbFirstName, vbProperCase)
    
Exit_tbFirstName_AfterUpdate:
    Exit Sub
    
Err_tbFirstName_AfterUpdate:
    MsgBox Err.Number & " - " & Err.Description
    Resume Exit_tbFirstName_AfterUpdate
    
End Sub
 
I have no idea how to use code. I am eager to learn, but I need more info as to where to put it, how to run it etc etc. I did put it into the property box under the after update box, and I edited it to reflect my control table name. I got bad juju messages back from that. Thanks, Tim
 
I just took the advice in ghudson's signature (did a serch). I went to the table and in the design view I put a > in the format section and it works!!!!!
 
Last edited:

Users who are viewing this thread

Back
Top Bottom