First Letter of Word to upper case

access2010

Registered User.
Local time
Yesterday, 16:49
Joined
Dec 26, 2009
Messages
1,118
We have tried to have the word in the field, Transaction, start with a Capital, without success.
We have also tried to have the contact name start with a capital, Bill Smith
>
>L<????????????????????????
><??????????????????
>?<???????????????????

Your suggestion on how to correct our problem will be appreciated

Thank you,
Nicole
 
Hi. Are you talking about an Input Mask or Formatting? Or maybe, are you trying to update existing data?
 
Deja Vu perhaps?

 
Try it...
Code:
Private Sub txtContactName_AfterUpdate()
    'For Proper Case
    Me.txtContactName = StrConv(Me.txtContactName, vbProperCase)
End Sub
 
Hi. Are you talking about an Input Mask or Formatting? Or maybe, are you trying to update existing data?

Thank you for your note.
We would like to use the Upper Case formatting for new data.
Thank you,
Crystal
 
Thank you for your note.
We would like to use the Upper Case formatting for new data.
Thank you,
Crystal
That sounds like an Input Mask then. Try the following in the Input Mask property.
Code:
>L<??????????????
Hope that helps...
 
Thank you for your suggestion, and the results are shown below
1597115253145.png
 
use the Change event of your textbox:
Code:
Private Sub textbox1_Change()
    Me.textbox1.Text = UCase(Me.textbox1.Text & "")
End Sub
 
use the Change event of your textbox:
Code:
Private Sub textbox1_Change()
    Me.textbox1.Text = UCase(Me.textbox1.Text & "")
End Sub
===
Thank you for your suggestion, arnelgp, but we receive a compile error in Access 2003.
Nicole
 
Just FYI, Input masks do not change data. They only affect how it is displayed so if you want to actually insure that the first letter is upper case when it is stored, you have to use one of the methods suggested above.

You didn't say what the compile error was but I would use the AfterUpdate event in any case rather than the Change event. The Change event runs multiple times. Once for each character typed but the AfterUpdate event runs only once.

Code:
Private Sub textbox1_Afterupdate()
    Me.textbox1 = UCase(Left(Me.textbox1, 1) & Mid(me.textbox1, 2)
End Sub
 
Just FYI, Input masks do not change data. They only affect how it is displayed...
Hi @Pat Hartman. I just gave it a try and got a different result

I created a table with two fields, an Autonumber and a Text field. I entered one record as "a." Went to table design and added an Input Mask of >L.

When I went back to Table View, the first record I entered earlier appeared as "A" now. I then entered a second record as "a" again. This, of course, immediately changed to "A" for me.

Then, I went to the Immediate Window and got the following results.
Code:
?dlookup("f1","Table1","id=1")
a
?dlookup("f1","Table1","id=2")
A
 
Last edited:
Why not use a propercase function there are a number posted.
 
Why not use a propercase function there are a number posted.
Mick,
This was asked by Access2010 (perhaps not the same person though) last December and they had a solution at the end of it all.
Now they are asking the same thing again?
 
Thank you for your suggestion, arnelgp, but we receive a compile error in Access 2003.
you need to replace textbox1 with the Correct textbox name.
 
use the Change event of your textbox:
Code:
Private Sub textbox1_Change()
    Me.textbox1.Text = UCase(Me.textbox1.Text & "")
End Sub

===
Thank you for your suggestion, but we have had no success.
Could you please look at the attached database and advise use what we have done wrong?

Thank you Nicole
 

Attachments

Users who are viewing this thread

Back
Top Bottom