StrConv Function

wolfegirl04

New member
Local time
Yesterday, 18:31
Joined
Mar 19, 2004
Messages
7
HELP With StrConv Function

I was wondering is there any way to get the first letter of every word or just the first word in a text fiels to be capitalized? like entered as: address 1500 blue dr and displayed as 1500 Blue Dr

a book that I have says
Format Setting @;"NO Data" will result in text entered as horse displayed as Horse. It does not work.

Another sugestion was to: use the StrConv() function in the After Update event of the control you want to have Proper Case. Search Access help for StrConv() and you will find the syntax you need there.

Should the code look like this:
StrConv(vbProperCase)
It does not work either.

I think I am missing a String: StrConv(string, conversion)
But I do not know wht the string is
Help
 
StrConv("1500 blue dr", vbProperCase)
 
dcx693 said:
StrConv("1500 blue dr", vbProperCase)

Thank you.

However the text is going to change for each record? and I want to use the code in other fields.
 
The string is a variable that you pass your field/textbox data to:
Code:
sub Textbox1_AfterUpdate()
dim strMyData as string
strMyData = Me.Textbox1.text
Me.Textbox1.text = StrConv(strMyData, vbProperCase)
end sub

you will have to add/copy it to each field that you want to use it on.
 
Last edited:
Calvin said:
Code:
sub Textbox1_AfterUpdate()
dim strMyData as string
strMyData = Me.Textbox1.text
Me.Textbox1.text = StrConv(strMyData, vbProperCase)
end sub
Calvin has the right idea on how to use the StrConv in the AfterUpdate of the text box. This will get you the same result, just a few less lines of code...
Code:
Sub Textbox1_AfterUpdate()
TextBox1 = StrConv(TextBox1, vbProperCase)
End Sub
 

Users who are viewing this thread

Back
Top Bottom