If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
send listbox items to report
Greetings,
I am looking for someone that could help me with the following situation. I have a listbox on the form that contains x amount of rows that user populates. I'd like to move all those rows to report in MS Access. Row Source Type is based on Valuelist not on table/query. However, I am only able to pass the selected row and this is the line I entered in the control source of the text box in the Report: For Quantity: =[Forms]![QuoteDetail]![lstResults2].Column(0) & "" & Chr$(10) Part Number: For Quantity: =[Forms]![QuoteDetail]![lstResults2].Column(1) & "" & Chr$(10) Description: For Quantity: =[Forms]![QuoteDetail]![lstResults2].Column(2) & "" & Chr$(10) Price: For Quantity: =[Forms]![QuoteDetail]![lstResults2].Column(3) & "" & Chr$(10) so the result in the report would look like this: Quantity Part Number Description Price 1 SUPP-0118 blah blah blah $xxx As I mentioned earlier I'd like to be able to pass all of the items to the report. I also included following code in the "Report_Open" event but for some reason it doesn't work...? Dim i As Long Dim str As String With Me!lstResults2 For i = Abs(.ColumnHeads) To (.ListCount - 1) str = "'" & .Column(0, i) & "' , " & _ "'" & .Column(1, i) & "' , " & _ "'" & .Column(2, i) & "' , " & _ "'" & .Column(3, i) & "'" stDocName = "rptQuote" DoCmd.OpenReport stDocName, acPreview Next i End With ----------------------------------------------------- Please tell me what am I doing wrong. I am new to this kind of things so please be gentle Thanks in advance -Rino |
#2
|
|||
|
|||
send listbox items to report
that's completely bizarre. Why would you try to base a report on the
contents of a listbox? Why not write the data to a table. That's what tables are for... but hey, that's just me. |
#3
|
|||
|
|||
send listbox items to report
or do you mean that you want to filter the report (that's based on
existing table or a query) by using a listbox to collect filter values? Then read this article: http://www.mvps.org/access/forms/frm0028.htm |
Thread Tools | |
Display Modes | |
|
|