Another UserForm Ques.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top