First Letter of Word to upper case (1 Viewer)

access2010

Registered User.
Local time
Today, 12:47
Joined
Dec 26, 2009
Messages
1,021
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:47
Joined
Oct 29, 2018
Messages
21,469
Hi. Are you talking about an Input Mask or Formatting? Or maybe, are you trying to update existing data?
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:47
Joined
Sep 21, 2011
Messages
14,273
Deja Vu perhaps?

 

smtazulislam

Member
Local time
Today, 22:47
Joined
Mar 27, 2020
Messages
806
Try it...
Code:
Private Sub txtContactName_AfterUpdate()
    'For Proper Case
    Me.txtContactName = StrConv(Me.txtContactName, vbProperCase)
End Sub
 

access2010

Registered User.
Local time
Today, 12:47
Joined
Dec 26, 2009
Messages
1,021
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:47
Joined
Oct 29, 2018
Messages
21,469
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...
 

access2010

Registered User.
Local time
Today, 12:47
Joined
Dec 26, 2009
Messages
1,021
Thank you for your suggestion, and the results are shown below
1597115253145.png
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:47
Joined
May 7, 2009
Messages
19,237
use the Change event of your textbox:
Code:
Private Sub textbox1_Change()
    Me.textbox1.Text = UCase(Me.textbox1.Text & "")
End Sub
 

access2010

Registered User.
Local time
Today, 12:47
Joined
Dec 26, 2009
Messages
1,021
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:47
Joined
Oct 29, 2018
Messages
21,469
Thank you for your suggestion, and the results are shown below
Hi. Since you are using numbers, try using this Input Mask.
Code:
>A<aaaaaaaaa
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 15:47
Joined
Feb 19, 2002
Messages
43,266
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 12:47
Joined
Oct 29, 2018
Messages
21,469
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:

Dreamweaver

Well-known member
Local time
Today, 20:47
Joined
Nov 28, 2005
Messages
2,466
Why not use a propercase function there are a number posted.
 

Gasman

Enthusiastic Amateur
Local time
Today, 20:47
Joined
Sep 21, 2011
Messages
14,273
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?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:47
Joined
May 7, 2009
Messages
19,237
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.
 

access2010

Registered User.
Local time
Today, 12:47
Joined
Dec 26, 2009
Messages
1,021
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

  • First_Letter_Uppercase.mdb
    168 KB · Views: 110

Users who are viewing this thread

Top Bottom