PC Review


Reply
Thread Tools Rate Thread

"ComboBox1.ListIndex = 0" Doesn't seem to always work.

 
 
JudgeMental
Guest
Posts: n/a
 
      29th Mar 2008
Hi,

I have "ComboBox1" on a UserForm. In the Sub Form Initialize procedure, I
have "ComboBox1.ListIndex = 0" hoping to set the ComboBox to Index 0 every
time the Form is loaded. The problem is that maybe 50% of the time it loads
up with the last selection instead. Am I doing something wrong?

Thank you for your help!
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      29th Mar 2008
If you are hiding your UserForm instead of unloading it, then the initialize
event won't fire when you show it again and your ComboBox will show the last
selected value. Since you didn't post all of your code, I can't tell you
much more.

"JudgeMental" wrote:

> Hi,
>
> I have "ComboBox1" on a UserForm. In the Sub Form Initialize procedure, I
> have "ComboBox1.ListIndex = 0" hoping to set the ComboBox to Index 0 every
> time the Form is loaded. The problem is that maybe 50% of the time it loads
> up with the last selection instead. Am I doing something wrong?
>
> Thank you for your help!

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      30th Mar 2008
If indeed the form was hidden, you could put the code into UserForm_Activate
to reset it when it is redisplayed.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______


"JLGWhiz" <(E-Mail Removed)> wrote in message
news:740361A4-E4AE-4E35-B925-(E-Mail Removed)...
> If you are hiding your UserForm instead of unloading it, then the
> initialize
> event won't fire when you show it again and your ComboBox will show the
> last
> selected value. Since you didn't post all of your code, I can't tell you
> much more.
>
> "JudgeMental" wrote:
>
>> Hi,
>>
>> I have "ComboBox1" on a UserForm. In the Sub Form Initialize procedure, I
>> have "ComboBox1.ListIndex = 0" hoping to set the ComboBox to Index 0
>> every
>> time the Form is loaded. The problem is that maybe 50% of the time it
>> loads
>> up with the last selection instead. Am I doing something wrong?
>>
>> Thank you for your help!



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query: "Double" Numeric Criteria Doesn't Work, But "Decmal" Does? PeteCresswell Microsoft Access 3 7th May 2008 05:46 PM
Outlook Express6 "Inbox" doesn't work. "Send" feature works okay. =?Utf-8?B?U291bmRoYXZlbg==?= Microsoft Outlook Discussion 2 29th Jun 2006 04:04 AM
Outlook Express6 "Inbox" doesn't work. "Send" feature works okay. =?Utf-8?B?U291bmRoYXZlbg==?= Microsoft Outlook Discussion 0 29th Jun 2006 03:15 AM
DataGrid - BorderStyle="None" and BorderWidth="None" doesn't work for Firefox David Freeman Microsoft ASP .NET 5 27th Dec 2004 05:27 AM
Clicking "Restart" doesn't work. It just"Turns Off" the Computer. Martin Windows XP Help 0 13th Dec 2004 11:31 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:32 PM.