ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Another UserForm Ques. (https://www.excelbanter.com/excel-programming/330928-another-userform-ques.html)

Jennifer

Another UserForm Ques.
 
Well having just put the finishing touches on my first user form I am now
starting another. Not real sure why!!!!
Is it possible in a user form to have the user say choose a produce item
from a drop down box (understand that much) and have the various id numbers
that correlate from the database show up in a list. Like in a label that is
made very large. Hope this makes sense.
User chooses: Plum
ID Pick Date Etc.
2 5-30-05
5 6-1-05
22 6-3-05

I know how to do this using the row function from the contextures website
but I really want to see the info all at once. I do not want the user to have
to press next to see another item that correlates.
Thank you. Jennifer


--
Though daily learning, I LOVE EXCEL!
Jennifer

Harald Staff

Another UserForm Ques.
 
Hi Jennifer

You don't say where and what your data is, but see if this get you started.
Userform with a combobox1 and a listbox1 on it. Userform code:

Private Sub UserForm_Initialize()
ComboBox1.AddItem "Plum"
ComboBox1.AddItem "Grape"
ListBox1.ColumnCount = 2
End Sub

Private Sub ComboBox1_Change()
Call ComboBox1_Click
End Sub

Private Sub ComboBox1_Click()
Dim R As Long
ListBox1.Clear

Select Case ComboBox1.ListIndex
Case 0
For R = 0 To 10
ListBox1.AddItem R + 101
ListBox1.List(R, 1) = "Plum " & R
Next
Case 1
For R = 0 To 10
ListBox1.AddItem R + 201
ListBox1.List(R, 1) = "Grape " & R
Next
Case Else
End Select
End Sub

HTH. Best wishes Harald

"Jennifer" skrev i melding
...
Well having just put the finishing touches on my first user form I am now
starting another. Not real sure why!!!!
Is it possible in a user form to have the user say choose a produce item
from a drop down box (understand that much) and have the various id

numbers
that correlate from the database show up in a list. Like in a label that

is
made very large. Hope this makes sense.
User chooses: Plum
ID Pick Date Etc.
2 5-30-05
5 6-1-05
22 6-3-05

I know how to do this using the row function from the contextures website
but I really want to see the info all at once. I do not want the user to

have
to press next to see another item that correlates.
Thank you. Jennifer


--
Though daily learning, I LOVE EXCEL!
Jennifer





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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com