key press

  • Thread starter Thread starter Lior Montia
  • Start date Start date
L

Lior Montia

Hi,

what is the command the press the home button.
I want that every time a text box got focus automatically the cursor goes to
the first char in the box.

thanks.
 
if you always want the cursor to be at the start of the field, you may
wish to change the default behavior

Tools, Options, Keyboard

Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
 
no, I want only in this field when it got focus instead the user will press
the home button that it will happened automatically
 
no, I want only in this field when it got focus instead the user will press
the home button that it will happened automatically


To change the cursor position to the start of the textbox when it
receives focus...

Private Sub TexBoxNamer_GotFocus()
Me!Text0.SelStart = 0
Me!Text0.SelLength = 0
End Sub
 
It doesn't work.
maybe because the text box got focus by pressing in with the mouse and not
by pressing TAB in the keyboard ?
 
It doesn't work.
maybe because the text box got focus by pressing in with the mouse and not
by pressing TAB in the keyboard ?


Shouldn't matter.
Did you change the names of the controls in the example to what you
actually have on the form?
IE. Me!Text0, Me!TextBox1, Me!TextBoxBob, Me![Actual Textbox Name]
 
give a little bit credit

storrboy said:
It doesn't work.
maybe because the text box got focus by pressing in with the mouse and
not
by pressing TAB in the keyboard ?


Shouldn't matter.
Did you change the names of the controls in the example to what you
actually have on the form?
IE. Me!Text0, Me!TextBox1, Me!TextBoxBob, Me![Actual Textbox Name]
 
it looks like it goes to the start of the field but then return to the
location I pressed with the mouse.
 
I understand what you mean now. It's because the Click event occurs
after the GotFocus event.
You'd have to perform the same operation in the click event. If this
was something you're doing to a lot of controls, make a common
function that accepts a control name reference as an argument. Each
control you want this occur in would call the common function passing
it's name and the function would act upon the referenced control.
 

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


Back
Top