Override fields

J

Joe

Is there any way to setup an event procedure for fields in
a form, to override existing data?
Thanks
Joe
 
J

John Vinson

Is there any way to setup an event procedure for fields in
a form, to override existing data?
Thanks
Joe

Yes.

For a more detailed answer, please ask a more detailed question!
 
J

Joe

By default, all fields are Add mode

I have a field with a phone number format, if I want to
change the last 4 digits; I have to highlight it and type
the new information. Is there any way to format the field
to edit mode, so when I type new information the old one
is automatically deleted.
Thanks again
Joe
 
J

John Vinson

By default, all fields are Add mode

I have a field with a phone number format, if I want to
change the last 4 digits; I have to highlight it and type
the new information. Is there any way to format the field
to edit mode, so when I type new information the old one
is automatically deleted.
Thanks again
Joe

I think you can do this by setting the SelStart and SelLength
properties of the textbox in the textbox's GotFocus event. For
instance, to automatically highlight just the last four digits (I too
live in a small town, and all phone numbers are (208) 722-xxxx) you
can use:

Private Sub txtPhone_GotFocus()
txtPhone.SelStart = 10
txtPhone.SelLength = 4
End Sub

Tweak these to match your phone format, input mask, and what part of
the number you want selected.
 
J

Joe

John,
Thanks

Actually your idea works fine if you always change the
same digits; however I don't know what I'll change.
The reason I mentioned a phone number format, because the
computer won't allow you too add a new digit until you
delete the old info, cause of the maximum digits.

Please help me
Thanks
 
B

Bas Cost Budde

Joe said:
By default, all fields are Add mode

I have a field with a phone number format, if I want to
change the last 4 digits; I have to highlight it and type
the new information. Is there any way to format the field
to edit mode, so when I type new information the old one
is automatically deleted.
Thanks again
Joe

Do your users appreciate that? What if one wants to change just one digit?
 
J

John Vinson

John,
Thanks

Actually your idea works fine if you always change the
same digits; however I don't know what I'll change.
The reason I mentioned a phone number format, because the
computer won't allow you too add a new digit until you
delete the old info, cause of the maximum digits.

You've lost me. Could you give me an example of what you want to
change? If you want Access to telepathically determine before you type
which character or characters you want to change, it's not going to
work...
 

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