No, that wouldn't work. Set the AfterUpdate event *property* to "[Event
Procedure]", and would write the following event procedure:
'----- start of suggested code -----
Private Sub LastName_AfterUpdate()
If IsNull(Me!LastName.OldValue) Then
Me!LastName = mixed_case(Me!LastName)
End If
End Sub
'----- end of suggested code -----
I added that test for the OldValue property to allow you to manually fix
a name that is miscapitalized by the mixed_case() function. So if you
enter a last name for someone that previously didn't have one entered,
it will be adjusted according to the function's rules. But if you
change an existing last name, the function won't be called. You can
take out that conditional test if you like.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)
Bruce Rodtnick said:
That code looks good, but I'm not able to get it to do anything. I'm
using =[mixed_case] in the After Update property in the text box
LastName. I've put the code in a separate module and I've also put
it in the code under that form. How should I address that function?
Bruce Rodtnick
Dirk said:
I have been using the simple Capitol macro to capitol the first
letter of words in my field and it works fine:
StrConv([Screen].[ActiveControl],3)
But some names have more than one capital in it (Smith-Jones;
MacDonald; R.C. Jones; etc.) Is there a way to ensure that those
special instances can be properly capitalized? I know we're going
to have to address each instance, but it should be able to done,
shouldn't it?
This page shows one approach:
http://www.mvps.org/access/strings/str0008.htm
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)