Update query to convert names to Proper format?

A

Amit

MS Access 2K, Windows XP
=========================
Hi,

I'm trying to convert first and last name fields in a
table to "Proper" format using an update query. I tried
using the StrConv([fieldname], vbProperCase) in
the "Update to" row, but that didn't work. I got a "MS
Access failed to update..." error message.

I'm assuming that this function is available in VBA and
not in an Update query. Is that the case? And, if yes,
then how can I convert the names to Proper format?

Thanks for any pointers.

-Amit
 
G

Gerald Stanley

The function works but Access won't recognise the constant
vbProperCase. If you change it to StrConv([fieldname], 3)
all should be well.

Hope This Helps
Gerald Stanley MCSD
 
A

Amit

Hi Gerald,

Thanks! That worked!! And, learned something new :)

Cheers,

-Amit
-----Original Message-----
The function works but Access won't recognise the constant
vbProperCase. If you change it to StrConv([fieldname], 3)
all should be well.

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
MS Access 2K, Windows XP
=========================
Hi,

I'm trying to convert first and last name fields in a
table to "Proper" format using an update query. I tried
using the StrConv([fieldname], vbProperCase) in
the "Update to" row, but that didn't work. I got a "MS
Access failed to update..." error message.

I'm assuming that this function is available in VBA and
not in an Update query. Is that the case? And, if yes,
then how can I convert the names to Proper format?

Thanks for any pointers.

-Amit

.
.
 
F

fredg

MS Access 2K, Windows XP
=========================
Hi,

I'm trying to convert first and last name fields in a
table to "Proper" format using an update query. I tried
using the StrConv([fieldname], vbProperCase) in
the "Update to" row, but that didn't work. I got a "MS
Access failed to update..." error message.

I'm assuming that this function is available in VBA and
not in an Update query. Is that the case? And, if yes,
then how can I convert the names to Proper format?

Thanks for any pointers.

-Amit

vbProperCase is a VBA constant.
If you are placing the StrConv() functon in the query you must use the
constant's value, 3, not the constant itself.

StrConv([FieldName],3)

Be aware StrConv() sometimes gives unintended results.
Some names do contain more than 1 capital, McDonald, O'Brien, IBM,
CBS, etc.
Some names contain more than one word, only one of which should be
capitalized, i.e. van den Berg, von Braun
Some names are hyphenated, i.e. Jones-Carlyle, which will result in
Jones-carlyle.

And then some people capitalize their names differently, Mcgregor -
McGregor, O'Connor - O'connor, etc.
 

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