> I have an application in VB6 that uses an Access 2000 database and generates
> various reports using Data Report. Everything works find except once I run
> a report, if I then edit any of the data and re-run the report, the edits do
> not appear. If I exit the application and re-start it, the edits then
> appear when I run the report. In other words, it is as if the Data Report
> binds to the data at the time it is first opened and it is never Refreshed
> even though I call rptMyReport.Refresh before calling rptMyReport.Show.
> The tables in the database are edited using ADO data controls while the
> reports are linked to commands in a data environment. Any suggestions would
> be greatly appreciated.
Yeah, this is a feature of DataReports. Seems like the recordset is
created when you first run the report...when you close the report, the
recordset stays open. When you run the report again, the recordset
doesn't get refreshed, so you're still looking at the same old data. Of
course, exiting the application and restarting will clear the recordset,
but that's not too elegant, eh?
What worked for me was adding a line of code to the _Terminate event
of the DataReport to close the recordset of the Command on which the
report is based:
DataEnvironment1.rsCommand3.Close
...but my app builds the SQL for the Command and re-Executes it every
time I run the report. Hope the same idea works in your case.
--
Jim in Cleveland
If you're writing to me, in my address
change "REAL_Address.see.below" to "worldnet.att.net"
"What's so funny 'bout peace, love & understanding?"
- Nick Lowe