Initial capital

  • Thread starter Thread starter gavin
  • Start date Start date
G

gavin

I have a field which I want to have an initial capital - I know this can be
done by an input mask but I was wondering how it would be done with VBA?
Some code in the Before Update property?


Thanks for any help,


Gavin
 
I will Lynn - I promise - but just in case I don't understand (this
newsgroup is called "getting stated, don't forget!) maybe you could give me
a bit more of a clue :-)

Regards,



Gavin
 
Public Function Pcase(strPassed As String) As String

'Convert into proper case string

Pcase = StrConv(strPassed, vbProperCase)


End Function

Copy the above function in the code of the form or into a VBA module. Call
it using a string : e.g. :: "the quick brown fox"

it will return :: "The Quick Brown Fox"



Ed Warren.
 
Hi Gavin,
What I should have said was, "Take a look at the StrConv() Function IN VBA
HELP." I try to live by the old adage, "Catch a fish for a hungry man and
you will provide him with a meal. Teach him to fish and you will feed him
for a lifetime." Ed has provided a good example of it. Be aware that
vbProperCase will not give what you want for a few problem situations -- the
name "macdonald" will come out as "Macdonald" instead of "MacDonald".

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html
 
Ed Warren said:
Public Function Pcase(strPassed As String) As String

'Convert into proper case string

Pcase = StrConv(strPassed, vbProperCase)


End Function

Copy the above function in the code of the form or into a VBA module. Call
it using a string : e.g. :: "the quick brown fox"

it will return :: "The Quick Brown Fox"


Ed,
I am obviously doing something wrong because this isn't working for me.
Where in the "code of he form" do I paste this?



Regards,



Gavin
 
Back
Top