Formating text in design view

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Trying to format first and last names, first letter caps, rest lower case.
Tried using the canned Access format >L<?????????, but this does not work.
Suggestions? Thanx, kbs...
 
Trying to format first and last names, first letter caps, rest lower case.
Tried using the canned Access format >L<?????????, but this does not work.
Suggestions? Thanx, kbs...

Let the user enter the data, using a form, normally.
Code the AfterUpdate event of the LastName control:
[LastName] = StrConv([LastName],3)

Do the same for the [FirstName] control.

Be aware that this will not properly capitalize all words and names,
as some names must always be in all caps (IBM, CBS, etc.), some never
capitalized (e.e. cummings), some have 2 capitals in the name
(McDonald, O'Connor) and some have a mixed set of capitalized names
(van der Meer), as well as all hyphenated names.

The only way to accurately handle names like these is to have a table
of exceptions, and DLookUp the table for that particular word before
changing it.

You would need to create a User Defined function to do all of this and
regularly maintain the list of names, adding new words as needed.

And, after all is said and done, there are still some words and names
that can be written both ways (O'Connor, O'connor, McDonald, Mcdonald)
as well as others whose capitalization depends on useage (ABC, abc,
Xerox, xerox, Access, access).
 
I'm not understanding your thread: Code the AfterUpdate event of the
LastName control: [LastName] = StrConv([LastName],3)

Where, exactly, is this established? It is not in the Format field, and, I
do not know what AfterUpdate event is...

Thanx, kbs...


fredg said:
Trying to format first and last names, first letter caps, rest lower case.
Tried using the canned Access format >L<?????????, but this does not work.
Suggestions? Thanx, kbs...

Let the user enter the data, using a form, normally.
Code the AfterUpdate event of the LastName control:
[LastName] = StrConv([LastName],3)

Do the same for the [FirstName] control.

Be aware that this will not properly capitalize all words and names,
as some names must always be in all caps (IBM, CBS, etc.), some never
capitalized (e.e. cummings), some have 2 capitals in the name
(McDonald, O'Connor) and some have a mixed set of capitalized names
(van der Meer), as well as all hyphenated names.

The only way to accurately handle names like these is to have a table
of exceptions, and DLookUp the table for that particular word before
changing it.

You would need to create a User Defined function to do all of this and
regularly maintain the list of names, adding new words as needed.

And, after all is said and done, there are still some words and names
that can be written both ways (O'Connor, O'connor, McDonald, Mcdonald)
as well as others whose capitalization depends on useage (ABC, abc,
Xerox, xerox, Access, access).
 
I'm not understanding your thread: Code the AfterUpdate event of the
LastName control: [LastName] = StrConv([LastName],3)

Where, exactly, is this established? It is not in the Format field, and, I
do not know what AfterUpdate event is...

Thanx, kbs...

fredg said:
Trying to format first and last names, first letter caps, rest lower case.
Tried using the canned Access format >L<?????????, but this does not work.
Suggestions? Thanx, kbs...

Let the user enter the data, using a form, normally.
Code the AfterUpdate event of the LastName control:
[LastName] = StrConv([LastName],3)

Do the same for the [FirstName] control.

Be aware that this will not properly capitalize all words and names,
as some names must always be in all caps (IBM, CBS, etc.), some never
capitalized (e.e. cummings), some have 2 capitals in the name
(McDonald, O'Connor) and some have a mixed set of capitalized names
(van der Meer), as well as all hyphenated names.

The only way to accurately handle names like these is to have a table
of exceptions, and DLookUp the table for that particular word before
changing it.

You would need to create a User Defined function to do all of this and
regularly maintain the list of names, adding new words as needed.

And, after all is said and done, there are still some words and names
that can be written both ways (O'Connor, O'connor, McDonald, Mcdonald)
as well as others whose capitalization depends on useage (ABC, abc,
Xerox, xerox, Access, access).

In Form Design View, select the Control you are using to enter the
name. Display that Control's Property sheet.
..
Click on the Event tab of the property sheet.
On the line that says AfterUpdate write:
[Event Procedure]
Click on the button with the 3 dots that will appear on that line.
When the code window opens, the cursor will be flashing between 2
already written lines. Write the code I gave you (just changing the
control name to whatever your actual control name is) between those 2
lines. Exit the code window.
Do the same for the other name field you wish to capitalize.

Anything you type in that control will be converted to Proper Case.
 
Back
Top