Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Printing information from Form on the report


Message #1 by "isha" <ishasingh74@y...> on Thu, 6 Dec 2001 16:29:13
Hi,

My user selects multiple values from a listbox....and based on these

values a report is generated.....now he wants to see his selections from

the list box at the top of the report...

can anybody help please
Message #2 by Mark Neill <mkneill@y...> on Thu, 6 Dec 2001 08:40:17 -0800 (PST)
--0-767981754-1007656817=:2559

Content-Type: text/plain; charset=us-ascii





 Add a control to the header section of the report that refers to the form and control that is on the listbox.

example:

=[Forms]![Report Criteria]![BeginDate]

 

  isha <ishasingh74@y...> wrote: Hi,

My user selects multiple values from a listbox....and based on these

values a report is generated.....now he wants to see his selections from

the list box at the top of the report...

can anybody help please








---------------------------------

Do You Yahoo!?

Send your FREE holiday greetings online at Yahoo! Greetings.


Message #3 by "Pardee, Roy E" <roy.e.pardee@l...> on Thu, 06 Dec 2001 08:59:27 -0800
If you leave the form with the listbox open while the report opens you can

read the values of the listbox from code in the Open event of your Report,

e.g.,



lblReportLabel.Caption 

Application.Forms("frmMyFormName").Controls("lstMyListBoxName").Value



HTH,



-Roy



Roy Pardee

Programmer/Analyst

SWFPAC Lockheed Martin IT

Extension 8487



-----Original Message-----

From: isha [mailto:ishasingh74@y...]

Sent: Thursday, December 06, 2001 8:29 AM

To: Access

Subject: [access] Printing information from Form on the report





Hi,

My user selects multiple values from a listbox....and based on these

values a report is generated.....now he wants to see his selections from

the list box at the top of the report...

can anybody help please




Message #4 by "John Ruff" <papparuff@c...> on Thu, 6 Dec 2001 09:05:38 -0800
You can create a procedure either in the rReport's Report Header On

Format event or the report's Page Header On Format event to enumerate

through the selected items in the form's listbox and post them to the

report.  Place a textbox in the report's Report or Page Header. In the

sample below, I've called the textbox txtSelectedItems and I placed it

in the Report Header.



Here's the code that will do it:



Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As

Integer)

    Dim ctlSource As Control

    Dim intCurrentRow As Integer

    

    Set ctlSource = Forms!frmlistbox!lstListSource

    

    txtSelectedItems = Null

    For intCurrentRow = 0 To ctlSource.ListCount - 1

        If ctlSource.Selected(intCurrentRow) Then

            If IsNull(txtSelectedItems) Then

                txtSelectedItems = ctlSource.Column(1, intCurrentRow)

            Else

                txtSelectedItems = txtSelectedItems & ", " &

ctlSource.Column(1, intCurrentRow)

            End If

        End If

    Next intCurrentRow

    

    Set ctlSource = Nothing



End Sub





John Ruff - The Eternal Optimist :-)







-----Original Message-----

From: isha [mailto:ishasingh74@y...] 

Sent: Thursday, December 06, 2001 4:29 PM

To: Access

Subject: [access] Printing information from Form on the report





Hi,

My user selects multiple values from a listbox....and based on these

values a report is generated.....now he wants to see his selections from

the list box at the top of the report... can anybody help please











  Return to Index