Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unexpected output while populating a combo box


Hi,

I am making a userform in Excel. In the userform, I have a multipage in
which on the loading of the form, I would want to see the combo box
populate itself. I am using the following code:


Code:
--------------------

Private Sub MultiPage1_Change()
With cbDataType
.AddItem ("----- Select Data Type -----")
.AddItem ("Text")
.AddItem ("Memo")
.AddItem ("Number")
.AddItem ("Date/Time")
.AddItem ("Currency")
.AddItem ("AutoNumber")
.AddItem ("Yes/No")
End With
End Sub

--------------------


When I do that, what happens is that the combo box does get populated
but everytime I switch back and forth between this Page (in which the
combo box is placed) and other pages, the list of items multiply. If I
switch between the pages thrice, the above items will appear thrice in
the combo box. I understand that this is because of the "change" event
of the multipage, but then what should I be doing to prevent that from
happening?

Please help.

Regards,

Shivboy


--
shivboy
------------------------------------------------------------------------
shivboy's Profile: http://www.excelforum.com/member.php...o&userid=35137
View this thread: http://www.excelforum.com/showthread...hreadid=548951

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unexpected output while populating a combo box


Either populate the combobox in the _Initialise event of the form, or
use

cbDataType.clear

in the MultiPage1_Change event before adding in the entries.


Col


--
colofnature
------------------------------------------------------------------------
colofnature's Profile: http://www.excelforum.com/member.php...o&userid=34356
View this thread: http://www.excelforum.com/showthread...hreadid=548951

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Unexpected output while populating a combo box


Hey Col,

That worked man! Thanks a lot for your help. Thanks !

Peace,

Shi

--
shivbo
-----------------------------------------------------------------------
shivboy's Profile: http://www.excelforum.com/member.php...fo&userid=3513
View this thread: http://www.excelforum.com/showthread.php?threadid=54895

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
Unexpected #N/A error from INDEX-MATCH combo [email protected] Excel Worksheet Functions 2 July 27th 07 01:13 PM
Excel VBA Combo Box Populating dependent on other combo box choices ikabodred Excel Programming 1 March 15th 06 03:16 PM
Populating Combo Boxes Tyrell Excel Programming 1 March 12th 06 02:38 PM
Populating a combo box John in Surrey Excel Programming 1 February 8th 06 04:56 PM
Populating a Combo Box Bryan Excel Programming 1 February 25th 05 06:50 PM


All times are GMT +1. The time now is 06:55 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"