Re: listbox problem
Since the 2nd listbox contains only items you want to have in the report, you can loop through the items and create a where clause for the OpenReport method. This is one way you can gain access to the items.
Originally posted by hendra1211
i have a form that consist of 2 listbox
the 1st listbox is populated with productname from product table
the 2nd is empty.
user drag and drop productname from the 1st listbox to the 2nd listbox. (it's up to them
how many records in the 2nd listbox)
then the user click a commandbutton that generates a report that consist of the product
listed only in the 2nd listbox.
i've understand how to populate the 2nd listbox with drag and drop method.
the problem is how to pass the parameter from the 2nd listbox to the criteria of the
Private Sub Command45_Click()
Dim lst As ListBox, x As Integer
Set lst = Me.lst1
For x = 0 To lst.ListCount - 1
Debug.Print lst.Column(0, x)
DAO, ADO, SQL, Automation and anything else I can pick up.