I have several drop lists on my form, with either numbers or names on them. I want to change it so each item on the drop list has a certain "value" to it. For example, if a was "1" on my first drop list and hello was "23", wen I select "a" and "hello" from the list and I click calculate, it will do the mathematical equation of 1*23. Is there any way?
louislam123
0
Newbie Poster
Recommended Answers
Jump to PostDo you mean the listindex property (for a listbox)?
Dim a As Integer Dim b As Integer Private Sub Command1_Click() If List1.ListIndex = -1 Then MsgBox "nothing selected" ElseIf List1.ListIndex = 0 Then a = List1.ListIndex + 1 MsgBox "The value is " & a a = …
Jump to PostTry to use the Listindex of the item
else
try to use ItemData property of the control.
Jump to PostThe code is already provided to you.
All 11 Replies
Prozeen
0
Junior Poster in Training
debasisdas
580
Posting Genius
Featured Poster
louislam123
0
Newbie Poster
debasisdas
580
Posting Genius
Featured Poster
Prozeen
0
Junior Poster in Training
choudhuryshouvi
33
Posting Pro
louislam123
0
Newbie Poster
debasisdas
580
Posting Genius
Featured Poster
choudhuryshouvi
33
Posting Pro
louislam123
0
Newbie Poster
choudhuryshouvi
33
Posting Pro
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.