Setfocus question

×

×לי

Hi,

I have 5 textboxes on a multipage control. In 4 of the textboxes, the user
should enter his details only once, while in the fifth textbox the user
should reply a question and click the OK button. No matter what was his
answer, he gets new question and the focus shouls be back to the fifth
textbox in order to reply the next question.
My problem is that I want that the user will be able to send his answers not
only by clicking the OK button but also by clicking 'Enter' after typing the
answer to the textbox, and I can't get the focus in the fifth textbox after
answering.

Thanks in advance for your help!

Eli
 
R

Ryan H

For your command button. In the VBE click the command button and set the
Default property to True. This will allow the user to hit enter and your
command button will be clicked.

I would put this in your command button Click Event. Hope this helps! If
so, let me know, click "YES" below.

Private Sub CommandButton1_Click()

' do something

TextBox5.SetFocus

End Sub
 
×

×לי

Thanks a lot!!

Ryan H said:
For your command button. In the VBE click the command button and set the
Default property to True. This will allow the user to hit enter and your
command button will be clicked.

I would put this in your command button Click Event. Hope this helps! If
so, let me know, click "YES" below.

Private Sub CommandButton1_Click()

' do something

TextBox5.SetFocus

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

Top