-
I am currently writing a VB application that uses a Data Environment linked to a table in Microsoft Access. I have based a report on this Data Environment, and when I display the report for the first time all is well, when I add infomation to the recordset that relates to the table in Access, and try to display the report again, the infomation is not updated in the Data Environment and I can't find out how to refresh it. Can anyone help me please ?
-
Maybe your query does not suffice what your report should display. It should always be refreshed when you open it. Try closing it first then open it.
-
The query runs when the data environment is loaded so I always get around this problem by unloading the data environment in the query close event of the report. I don't know if there is a better way but this works!
-
Thank you !
Thankyou very much, I was beginning to think there was no way to do it !!!
-
I also encountered the same problem, but i tried cancelling the query in the query close event, but still cannot work, is that how you unload a data environment in the query close event of the report? Please help...Thank u very much
-
Try this. I got it from one of the threads here...
'close the DE Command, then use the DR Refresh method
'add "rs" prefix to CommandName to identify it as a recordset
'ex.
Private Sub cmdButtonName_Click()
On Error Resume Next
If DE.rsCommandName.State = adStateOpen Then
DE.rsCommandName.Close
End If
dtrReportName.Refresh
dtrReportName.Show (vbModal)
Unload dtrReportName
End Sub
;)
-
Eimroda, Thank YOU very much!!! It works perfectly!