By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,027 Members | 1,261 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,027 IT Pros & Developers. It's quick & easy.

Capitalize first letter instead of entire string.

blyxx86
100+
P: 256
I have the code to capitalize an entire string when it is input, but would like to capitalize just the first letter of a box, or match the case of a drop down list..

My current code is thus:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Serial_AfterUpdate()
  2.     'Makes serial field input all caps into database no matter what.
  3.     Me.Serial = StrConv(Me.Serial, vbUpperCase)
  4. End Sub
  5.  
Perhaps there is a way to change "StrConv" to another piece of code that is more specific, and allows wildcards?

Another option, I have a drop down list of names, but I type in the first few letters first, and then select from there, is there a way for it to match the case of the drop down field instead?
Nov 21 '06 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
If you want to convert the first letter of each word, just use vbProperCase. Converting just the first letter would be fairly simple, by concatenating = Ucase(Left(Me.Serial, 1)) & Mid(Me.Serial, 2).

Beyond that it's getting a little more complex, and I don't have the time to address it now. Hopefully someone else will.
Nov 21 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.