A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

send listbox items to report



 
 
Thread Tools Display Modes
  #1  
Old August 9th, 2006, 10:57 PM posted to microsoft.public.access.forms
Rino
external usenet poster
 
Posts: 14
Default 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  
Old August 10th, 2006, 01:44 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 264
Default 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  
Old August 10th, 2006, 06:32 AM posted to microsoft.public.access.forms
[email protected]
external usenet poster
 
Posts: 264
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:28 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.