Focus Error

L

Lori

I have a couple controls on a form with input masks. I received a tip on how
to set the focus at the beginning of the field for data entry: it is the
following on the on focus event of the control:

Private Sub Telephone_Nbr_GotFocus()
Me.SelStart = 0
End Sub

I am getting a compile error though - it happens when I click in the field -
it is error #461 Method or Data Member not found. I'm not sure why this is
happening - I just wanted a way for the user to not start entering data in
the middle of the field an have to start over because their cursor was in the
middle of the input mask.

Thanks for any help!
 
K

Klatuu

You need to include the name of your control:
Me.SelStart = 0
should be
Me.Telephone_Nbr.SelStart = 0
 
L

Lori

Thanks for your quick reply! It worked!

Klatuu said:
You need to include the name of your control:
Me.SelStart = 0
should be
Me.Telephone_Nbr.SelStart = 0
 

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