Print Report from Listbox

echorley

Registered User.
Local time
Today, 15:16
Joined
Mar 11, 2003
Messages
131
I have a report that is dependent on the content of a single text box (a student's name). I would like to be able to select multiple names from a listbox and loop through those names to print the reports. So far, no success.

I believe that if I could pass the name of the student during the loop to the text box, the report would print properly.

Below is an attempt to pass the names in the listbox to the textbox.

Set frm = Forms![Student Reports]
Set ctl = frm![lstStudentNames]

For Each vItem In ctl.ItemsSelected

Me.txtCurrentStudentName = ctl.ItemsSelected

Next v Item

Obviously this is not correct. Any ideas?

Thanks.
 
Got it!

The following bit of code will populate the textbox during a loop with either one or multiple selections of a list box.

Me.txtCurrentStudentName = Me.txtStudentCurrentStudentName & Me.lstStudentNames.Column(1, vItem)
 

Users who are viewing this thread

Back
Top Bottom