View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default 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