Ucase, Lcase, First Letter Upper Case?

M

mcl

We're using office 2007 at work now (downgrade as far as I'm concerned).

But I have a question about UCase & LCase. Seems I remember seeing a command
to capitalize the 1st letter only but I can't find it. Is there one like
that?
 
F

fredg

We're using office 2007 at work now (downgrade as far as I'm concerned).

But I have a question about UCase & LCase. Seems I remember seeing a command
to capitalize the 1st letter only but I can't find it. Is there one like
that?

Look up the StrConv() function in VBA help.
In VB you would use:
=StrConv([FieldName],vbProperCase)

AS you have posted this to an Access Query newsgroup, in a query you
would have to use the constant vbProperCase's value of 3 (instead of
vbProperCase).
NewField:StrConv([FieldName],3)

Note: This will improperly capitalize some names that should have more
than one capital, i.e. McDonald, O'Brien, etc.
 
M

mcl

Ok, more info. When I just tried strconv() in the same older database I've
been using for a while at home it gave me the undefined error. But when I
created a new database just to try it out it worked. What's going on?


fredg said:
We're using office 2007 at work now (downgrade as far as I'm concerned).

But I have a question about UCase & LCase. Seems I remember seeing a
command
to capitalize the 1st letter only but I can't find it. Is there one like
that?

Look up the StrConv() function in VBA help.
In VB you would use:
=StrConv([FieldName],vbProperCase)

AS you have posted this to an Access Query newsgroup, in a query you
would have to use the constant vbProperCase's value of 3 (instead of
vbProperCase).
NewField:StrConv([FieldName],3)

Note: This will improperly capitalize some names that should have more
than one capital, i.e. McDonald, O'Brien, etc.
 
J

John W. Vinson

Ok, more info. When I just tried strconv() in the same older database I've
been using for a while at home it gave me the undefined error. But when I
created a new database just to try it out it worked. What's going on?

Probably a References problem.

Open any module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the .DLL files
required by Access will probably be marked MISSING. Uncheck it, recheck it,
close and open Access.

If none are MISSING, check any reference; close and open Access; then uncheck
it again. This will force Access to relink the libraries.
 

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

Top