ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setfocus question (https://www.excelbanter.com/excel-programming/438800-setfocus-question.html)

אלי

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

Ryan H

Setfocus question
 
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

--
Cheers,
Ryan


"אלי" wrote:

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


אלי

Setfocus question
 
Thanks a lot!!

"Ryan H" wrote:

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

--
Cheers,
Ryan


"אלי" wrote:

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



All times are GMT +1. The time now is 01:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com