Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SetFocus question Patrick C. Simonds Excel Programming 2 September 28th 08 07:43 AM
setfocus ranswrt Excel Programming 2 July 22nd 08 02:56 AM
userform setfocus question Gary Keramidas Excel Programming 3 November 27th 06 09:20 PM
SetFocus Question Sam Excel Programming 2 August 20th 04 04:01 PM
UserForm1.Textbox1.SetFocus Question Zane Greer Excel Programming 1 September 14th 03 11:59 AM


All times are GMT +1. The time now is 08:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"