Edit field

G

Garry Jones

When I activate a field in a form it is highlighted and at first click
the users loses the previous entry. Sometimes the user just wants to
correct a spelling mistake. Any simple way of getting fields to open
with the cursor at postion 1 and the previous entry not highlighted?

Garry Jones
Sweden
 
T

tina

add the following code to the form's Open event procedure, as

Application.SetOption "Behavior Entering Field", 1

and the following code to the form's Close event procedure, as

Application.SetOption "Behavior Entering Field", 0

the first action sets the behavior for the whole database (possibly for all
other dbs opened on that PC, as well - i didn't test it). so the second
action sets the behavior back to the default when the form is closed.

if you don't know how to add an event procedure to a form, see "Create a VBA
event procedure" at http://home.att.net/~california.db/instructions.html for
illustrated instructions.

hth
 
J

John Spencer

If you want to do this for only one control, you can use the Got Focus Event
to modify the behavior for that control. For instance, with a control named
fText

Private Sub fText_GotFocus()
Me.fText.SelLength =0
Me.fText.SelStart=0
End Sub
 

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

Similar Threads

Hyperlink Edit 3
Allow Edits 1
Weekdayname 3
Skip Field Value 1
Validating Text on an Entry Field 3
Change field information 2
How to keep arrow keys inside a field? 4
selecting an entire field 9

Top