ProperCase problem

  • Thread starter Birgit via AccessMonster.com
  • Start date
B

Birgit via AccessMonster.com

Hi!

I have a problem with ProperCase. My code is following:

Public Function Aa(strToChange As String) As String
Aa = StrConv(strToChange, vbProperCase)
End Function

This works properly with text in the text box but with no text the result is
#Error. Is there another way to convert text?

Thanks for advance
Birgit
 
J

J_Goddard via AccessMonster.com

If I understand you correctly, the problem is with blank or null textboxes.
Try using this:

Public Function Aa(strToChange As String) As String
Aa = StrConv(nz(strToChange," "), vbProperCase)
End Function

John
 
B

Birgit via AccessMonster.com

J_Goddard said:
If I understand you correctly, the problem is with blank or null textboxes.
Try using this:

Public Function Aa(strToChange As String) As String
Aa = StrConv(nz(strToChange," "), vbProperCase)
End Function

John

A little modification and it works! I left the original VBA code as it is. I
put the Aa-function into the textbox an placed the Nz function in it:

=Aa(Nz([TextBoxName];" "))

Birgit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top