Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Userform Focus

Hi

I've got a userform (called stagedetails) with a combobox (called combobox3)
that should always be the active control when the form is shown.

It works perfectly the first time but once a button on the form has been
clicked I can't change the focus back.

The form can be seen at www.thestormdragon.com The default button is "Save
and Return".

I've tried unloading and reloading / hiding and showing but it makes no
difference and the vba code of

stagedetails.combobox3.setfocus

doesn't work.

I've searched through this group and the google group archives without
success. Any ideas?

Many thanks

David


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Userform Focus

Use

Private Sub UserForm_Initialize()
Me.ComboBox3.SetFocus
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"David Coleman" wrote in message
...
Hi

I've got a userform (called stagedetails) with a combobox
(called combobox3) that should always be the active control
when the form is shown.

It works perfectly the first time but once a button on the form
has been clicked I can't change the focus back.

The form can be seen at www.thestormdragon.com The default
button is "Save and Return".

I've tried unloading and reloading / hiding and showing but it
makes no difference and the vba code of

stagedetails.combobox3.setfocus

doesn't work.

I've searched through this group and the google group archives
without success. Any ideas?

Many thanks

David



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Userform Focus

Hi Chip

I've just tried that and it makes no difference.

Is there anyway of tracking what it's doing / finding out why it's failing?

Thanks

David

"Chip Pearson" wrote in message
...
Use

Private Sub UserForm_Initialize()
Me.ComboBox3.SetFocus
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"David Coleman" wrote in message
...
Hi

I've got a userform (called stagedetails) with a combobox (called
combobox3) that should always be the active control when the form is
shown.

It works perfectly the first time but once a button on the form has been
clicked I can't change the focus back.

The form can be seen at www.thestormdragon.com The default button is
"Save and Return".

I've tried unloading and reloading / hiding and showing but it makes no
difference and the vba code of

stagedetails.combobox3.setfocus

doesn't work.

I've searched through this group and the google group archives without
success. Any ideas?

Many thanks

David





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Userform Focus

With userform_activate() , rather than userform_initialize, it
works perfectly.

Thanks

David


"David Coleman" wrote in message
...
Hi Chip

I've just tried that and it makes no difference.

Is there anyway of tracking what it's doing / finding out why it's
failing?

Thanks

David

"Chip Pearson" wrote in message
...
Use

Private Sub UserForm_Initialize()
Me.ComboBox3.SetFocus
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"David Coleman" wrote in message
...
Hi

I've got a userform (called stagedetails) with a combobox (called
combobox3) that should always be the active control when the form is
shown.

It works perfectly the first time but once a button on the form has been
clicked I can't change the focus back.

The form can be seen at www.thestormdragon.com The default button is
"Save and Return".

I've tried unloading and reloading / hiding and showing but it makes no
difference and the vba code of

stagedetails.combobox3.setfocus

doesn't work.

I've searched through this group and the google group archives without
success. Any ideas?

Many thanks

David







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
how to keep focus on txt_box in userform Pierre via OfficeKB.com Excel Programming 5 September 5th 05 03:46 PM
Object on userform can't get focus Jos Vens[_2_] Excel Programming 3 February 28th 05 11:50 PM
Show userform without it taking focus? leah Excel Programming 2 August 10th 04 07:07 PM
Focus on Control before UserForm(s) pop up Bob Phillips[_6_] Excel Programming 0 May 5th 04 04:03 PM
UserForm Loss Focus Orlando Magalhães Filho Excel Programming 2 September 5th 03 04:47 AM


All times are GMT +1. The time now is 10:27 PM.

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

About Us

"It's about Microsoft Excel"