Results 1 to 4 of 4

Thread: Report Question

  1. #1

    Thread Starter
    Lively Member muzzi's Avatar
    Join Date
    May 2001
    Location
    syd.nsw.au
    Posts
    79

    Arrow Report Question

    Hello,

    I have a little problem with a report.

    I use this code to call the report :

    On Error GoTo damn
    DataEnvironment2.Commands("calendar").CommandText = "select * from calendar where time=""" + Text1.Text + """ And Date=""" + Text2.Text + """"
    DataReport1.Refresh
    DataReport1.Show
    Exit Sub
    damn:
    MsgBox "Error creating report."
    this works fine. But the thing is, its like it caches the results. As when text1 and text2 change, and I recall the report, I get the same result!

    at first I thought it was a problem with my SQL, so I created another button to acall the same report but with a different SQL line.

    On Error GoTo damn
    DataEnvironment2.Commands("calendar").CommandText = "select * from calendar where Date=""" + ListView1.ListItems(1).SubItems(1) + """ order by time"
    DataReport1.Refresh
    DataReport1.Show
    Exit Sub
    damn:
    MsgBox "Error creating report."
    anyway, this works just fine also. But then when I try to call the the report with the other code, I get the results for this one.

    If that makes sense. Essentially, I am changing the SQL statement every time I call the report, but it seems to be "caching" the report and showing me a previously called one instead of the one I just called.

    Does that make sense?

    Does anyone know a cure?

    Thanks alot

  2. #2

    Thread Starter
    Lively Member muzzi's Avatar
    Join Date
    May 2001
    Location
    syd.nsw.au
    Posts
    79
    ^

    so no-one knows why my report is showing a previous SQL query instead of my new one?

  3. #3
    Junior Member
    Join Date
    Feb 2002
    Posts
    21
    ya, its pretty simple actually, and when i had this problem i was tearing my hair out for 3 days, lol.
    the dataenvironment command's recordset is still open, simply close it and you'll be fine
    the record set close command should be something like DataEnvironment2.rsCalender.Close
    people who insist on calling assembly "assembler" should have their pc's taken and be given a bristle buddy building set

  4. #4

    Thread Starter
    Lively Member muzzi's Avatar
    Join Date
    May 2001
    Location
    syd.nsw.au
    Posts
    79
    Originally posted by drefsab
    ya, its pretty simple actually, and when i had this problem i was tearing my hair out for 3 days, lol.
    the dataenvironment command's recordset is still open, simply close it and you'll be fine
    the record set close command should be something like DataEnvironment2.rsCalender.Close
    excellent thanks alot!

    Works perfectly now, Thank you so much

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