Results 1 to 5 of 5

Thread: DataGrid to be printed in DataReport

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    108

    DataGrid to be printed in DataReport

    How do I do that?

    I've used the following code

    Code:
    openDB
    poproDB.Open "SELECT * FROM trans WHERE status = '" & "finished" & "' AND (podate >= #" & Format(DTPicker1.Value, "mm/dd/yyyy") & "# AND podate <= #" & Format(DTPicker2.Value, "mm/dd/yyyy") & "#)"
    
        Set rptReports.DataSource = poproDB
    
        rptReports.Show
    but nothing shows on the data report.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: DataGrid to be printed in DataReport

    Any erros?

    Are you certain you have records that meet that query criteria?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    108

    Re: DataGrid to be printed in DataReport

    There are no errors, and the datagrid displays the result meaning there are records that meet the query criteria. Maybe it is because the datareport has nothing in it, it is blank, I haven't placed any form of fields or label in it. I just call it and set the datasource. Is there anything I should do with the report to display the results?

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    108

    Re: DataGrid to be printed in DataReport

    I've put a textbox in the report and use this code

    Code:
    rptReports.Sections("Section1").Controls.Item("Text1").DataField = poproDB.Fields("podate")
    but it says that DataField Not Found.

  5. #5
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: DataGrid to be printed in DataReport

    Set the DataField property of a control to the name of the field in the recordset.

    rptReports.Sections("Section1").Controls.Item("Text1").DataField = "podate"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width