Click to See Complete Forum and Search --> : Refreshing Data Environments
TomJaep
Sep 27th, 2000, 05:04 AM
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 ?
RIVES
Sep 27th, 2000, 02:38 PM
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.
Cenobite
Sep 28th, 2000, 11:21 AM
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!
TomJaep
Sep 29th, 2000, 08:03 AM
Thankyou very much, I was beginning to think there was no way to do it !!!
figo
Jul 15th, 2001, 09:49 AM
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
eimroda
Jul 15th, 2001, 08:02 PM
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
;)
figo
Jul 16th, 2001, 07:20 AM
Eimroda, Thank YOU very much!!! It works perfectly!
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.