Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing from a Multiselect Listbox....

Status
Not open for further replies.

docmeizie

Programmer
Aug 5, 2003
326
US
Well here is the deal I am going to create a form that has a list box loaded with people whose accounts I have just updated. The list box will be multiselect because I want to print out both Invoices and Envelopes of the people I just updated (mass mailing of the sort). I already know the events will be an on click. Just was wondering how do I get the group that I selected to go to the printer?

If I take a peek in your Windows, to fix a problem, does that make me a "Peeping Tom"? Hmmmmmmmmmmv [pc1][shocked]
 
Assuming you have the Invoice and Envelope info in a report then you would just do the printing inside a For..Next loop. Something like this.

Dim varItem as Variant
Dim ctl as Control
set ctl = Me.ListboxName
For Each varItem in ctl.ItemsSelected
Docmd.OpenReport "InvoiceReportName", acViewNormal,,[Name] = '" & ctl.ItemData(varItem) & "'"
Docmd.OpenReport "EnvelopeReportName", acViewNormal,,[Name] = '" & ctl.ItemData(varItem) & "'"
DoCmd.Close acReport "InvoiceReportName"
Docmd.Close acReport "EnvelopeReportName"
Next varItem


Paul
 
Cool thanks Paul that works jsut fine.

If I take a peek in your Windows, to fix a problem, does that make me a "Peeping Tom"? Hmmmmmmmmmmv [pc1][shocked]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top