Edit field

  • Thread starter Thread starter Garry Jones
  • Start date Start date
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
 
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
 
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

Allow Edits 1
Hyperlink Edit 3
Weekdayname 3
Hide fields 1
Skip Field Value 1
Validating Text on an Entry Field 3
Why is cursor in certain field when opening Form? 3
Split Database - FE edits allowed? 10

Back
Top