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.
Re: DataGrid to be printed in DataReport
Any erros?
Are you certain you have records that meet that query criteria?
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?
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.
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"