Capitalization

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi. I have a form where I would like to force
capitalization even if the user enters lower case
letters. Can this be done?

Thanks,
Mike.
 
add an event procedure to the control's AfterUpdate event, with the
following code

Me.ControlName = Nz(StrConv(Me.ControlName, vbUpperCase), Null)

this will change the value to all uppercase. to capitalize the first letter
of each word, use vbProperCase instead of vbUpperCase.

hth
 
Mike said:
Hi. I have a form where I would like to force
capitalization even if the user enters lower case
letters. Can this be done?

There are several ways to go about this. The simplest way IMO is to
convert what the user enters in a text box to upper case imediately
after entry is complete, using code in the text box's AfterUpdate event.
The event procedure would look something like this:

Private Sub txtMyTextBox_AfterUpdate()
Me.txtMyTextBox = UCase(Me.txtMyTextBox)
End Sub
 

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