Results 1 to 7 of 7

Thread: Refreshing Data Environments

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Location
    England
    Posts
    18

    Exclamation

    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 ?

  2. #2
    Addicted Member
    Join Date
    Sep 1999
    Location
    Philippines
    Posts
    196
    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.

  3. #3
    Lively Member
    Join Date
    Aug 2000
    Location
    Bristol, UK
    Posts
    86
    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!

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2000
    Location
    England
    Posts
    18

    Cool Thank you !

    Thankyou very much, I was beginning to think there was no way to do it !!!

  5. #5
    New Member
    Join Date
    Jul 2001
    Posts
    2
    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

  6. #6
    Fanatic Member eimroda's Avatar
    Join Date
    Jul 2000
    Location
    Philippines
    Posts
    642
    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

    On Error GoTo Hell

    Hell:
    Kill Me


    Food For Thought:

    - Do not judge a book... if you're not a judge!


  7. #7
    New Member
    Join Date
    Jul 2001
    Posts
    2

    Thumbs up

    Eimroda, Thank YOU very much!!! It works perfectly!

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