VB Use of Function Disables Navigation Buttons

C

Clint Marshall

I'm having trouble using the function MyName = StrConv(MyName,
vbProperCase) to capitalize names.
I'm using this in Access 2003 VB when I Exit the MyName control.
If I enter a name and press Enter or Tab, capitalization is fixed and
the focus moves to the next field as it should. If, however, I am in the
MyName control and click one of the record navigation buttons at the bottom
of the form, capitlaization is fixed, but I'm left in the same control on
the same record, but now the field is highlighted.
What do I need to do to correct the capitalization when I leave a field,
but still have the option of leaving the field by Enter, Tab, or moving to a
new record?

Here's the actual code:

---------------------
Private Sub MyName_Exit(Cancel As Integer)

MyName = StrConv(MyName, vbProperCase)

End Sub
 
G

Graham R Seach

Clint,

Try using the AfterUpdate event instead.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
C

Clint Marshall

Thanks Graham!
Now I get an error box saying "The expression After Update you entered as
the event property setting porduced the following error: Procedure
declaration does not match description of event or procedure having the same
name."
What's this mean?
 
G

Graham R Seach

Client,

<<<What does this mean?>>
Exactly what it says.

The syntax for the AfterUpdate event for a control called "MyName" is as
follows:
Private Sub MyName_AfterUpdate()
End Sub

If it is different, then there's your problem.

Try selecting Compile from the Debug menu. That'll show you where the error
lies.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 

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