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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

create report (to export to excel) from values selected in list box

Status
Not open for further replies.

DSburgh

MIS
May 19, 2005
26
US
Here's the deal. I have a list box that I want users to be able to select (multi select = Extended) rows to export to excel, but before that can happen I think I have to populate a report to use as a template.

I have a Shipper table and each table is made up of one or more Components from the Component table. The first column list box is populated with the Material_Code which is unique for each Shipper and links each Component to a single Shipper.

Do I even need the report template or can I just kick out each field to excel? Will using the report over complicate things or make it easier?

I know it will go something like
For intX = 0 to lst_view.List - 1
'if selected, kick it out to the report or excel
Next intX

Forgive me for I am a measly intern and do not have much experience in creating cross-application solutions such as this. Any help you can provide is much appreciated. TIA
 
DSburgh,

Sounds like you need to create a parameter query exported to excel, with the parameter value selected form the value of your listbox.

Take a look at
1. Parameter query
2. DoCmd.TransferSpreadsheet method

Post if more help needed
 
You don't need to have a report for a template. You can use code to open Excel. Then loop through the values of your list box and put them into Excel. I've not used list boxes with multi select yet so I'm not sure of all of the code. Thread thread705-1064341 has some code in it that opens Excel and passes values to fields that should help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top