Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default the most frustrating control


does anybody know of a site, book, or even person that know EXACTLY how
a combo box works in Excel 2003 userforms? i've been looking
everywhere and just about every source i've found either doesn't even
give that control the time of day, or lies about what events get called
when or what properties hold what.

any help is appreciated,
sven


--
medicenpringles


------------------------------------------------------------------------
medicenpringles's Profile: http://www.excelforum.com/member.php...o&userid=16458
View this thread: http://www.excelforum.com/showthread...hreadid=492920

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default the most frustrating control

Perhaps describing the problem rather than just sounding off will help us to
help you.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"medicenpringles"
<medicenpringles.1zybhm_1134431701.879@excelforu m-nospam.com wrote in
message news:medicenpringles.1zybhm_1134431701.879@excelfo rum-nospam.com...

does anybody know of a site, book, or even person that know EXACTLY how
a combo box works in Excel 2003 userforms? i've been looking
everywhere and just about every source i've found either doesn't even
give that control the time of day, or lies about what events get called
when or what properties hold what.

any help is appreciated,
sven


--
medicenpringles


------------------------------------------------------------------------
medicenpringles's Profile:

http://www.excelforum.com/member.php...o&userid=16458
View this thread: http://www.excelforum.com/showthread...hreadid=492920



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default the most frustrating control

any help is appreciated,

What help do you expect when you're obviously sounding off rather than
asking a question that can be answered effectively.

Certainly XL/VBA Help doesn't lie, and there's extensive information
there about comboboxes, their properties and methods, and it lists all
the events that are fired. That doesn't mean there aren't bugs or that
you're interpreting the information correctly, of course.

What don't you understand?

In article
<medicenpringles.1zybhm_1134431701.879@excelforu m-nospam.com,
medicenpringles
<medicenpringles.1zybhm_1134431701.879@excelforu m-nospam.com wrote:

does anybody know of a site, book, or even person that know EXACTLY how
a combo box works in Excel 2003 userforms? i've been looking
everywhere and just about every source i've found either doesn't even
give that control the time of day, or lies about what events get called
when or what properties hold what.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default the most frustrating control


what i have is a userform with a combo box, cmbSelectIngredient, and two
text boxes, txtIngredientName and txtAmount. in the DropButtonClick
event of the combo box i have this code:

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

Private asIngredientNames(24) As String
Private adIngredientAmounts(24) As Single

Private Sub cmbSelectIngredient_DropButtonClick()
If txtIngredientName.Text = "" Then
Exit Sub
Else
asIngredientNames(cmbSelectIngredient.ListIndex) = CStr(txtIngredientName.Text)
End If
If txtAmount.Text = "" Then
adIngredientAmounts(cmbSelectIngredient.ListIndex) = 0
Else
adIngredientAmounts(cmbSelectIngredient.ListIndex) = CSng(txtAmount.Text)
End If

cmbSelectIngredient.AddItem "Ingredient " & cmbSelectIngredient.ListIndex + 1
End Sub
--------------------


and in the Change event i have this code:

Code:
--------------------
Private Sub cmbSelectIngredient_Change()
If asIngredientNames(cmbSelectIngredient.ListIndex) < "" Then
If adIngredientAmounts(cmbSelectIngredient.ListIndex) = 0 Then
GoTo Skip
Else
txtAmount.Text = adIngredientAmounts(cmbSelectIngredient.ListIndex)
End If
txtIngredientName.Text = asIngredientNames(cmbSelectIngredient.ListIndex)
End If
Skip:
txtIngredientName.Text = ""
txtAmount.Text = ""
End Sub
--------------------

and this as initialization:

Code:
--------------------
Private Sub UserForm_Initialize()
cmbSelectIngredient.AddItem "Ingredient " & 1
cmbSelectIngredient.ListIndex = 0
End Sub
--------------------


basically, what i try to achieve with this code is storing a string and
a single into thier corresponding arrays, then when a previously stored
ingredient is selected, i would like to fill the textboxes with the
information previously stored in the array. but i'm getting all sorts
of problems. mainly because i can't figure out how to recall the
values into the textboxes. my code seems like it would do it, but
since the ListIndex isn't changed until after the Change event it
called, i think it may be impossible to do because i can't predict
which line the user will select. maybe there's some way of finding out
which line is selected before the Change event is called?


--
medicenpringles


------------------------------------------------------------------------
medicenpringles's Profile: http://www.excelforum.com/member.php...o&userid=16458
View this thread: http://www.excelforum.com/showthread...hreadid=492920

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
the most frustrating control Alok Excel Programming 0 December 13th 05 12:29 AM
Very Frustrating - Please Help! picklevote Excel Worksheet Functions 1 September 14th 05 01:32 AM
Frustrating Problem Rebecca New Users to Excel 3 April 4th 05 02:35 PM
Simple but frustrating Gordon[_2_] Excel Programming 4 December 18th 04 09:06 PM
Bizarre and frustrating bug NJD Excel Programming 5 January 28th 04 09:50 PM


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