Results 1 to 5 of 5

Thread: VB Data Report Open

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    VB Data Report Open

    Hi,

    I have a DataEnvironment and a DataReport in my Visual Basic project, in which I am using Access database. When I produce the report, during run-time, and when I close the report, and try to execute another SQL query to produce a second report I get an error, that the object (my DataReport) cannot stay open...

    Can anyone pls help?

  2. #2
    Frenzied Member d3gerald's Avatar
    Join Date
    Jan 2006
    Posts
    1,348

    Re: VB Data Report Open

    i dont know if this is right or if it can help but just try this.

    on the terminate event of your query, set the datareport recordsource = nothing
    On error goto Trap

    Trap:
    in case of emergency, drop the case...

    ****************************************
    If this post has been resolved. Please mark it as "Resolved" by going through the "Thread Tools" above and clicking on the "Mark Thread Resolved " option.
    if a post is helpful to you, Please Rate it by clicking on the Rate link right below the avatar

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Re: VB Data Report Open

    the run-time error that appears is :

    "Run-time error 3705: Operation is not allowed when the object is open"

    And when I press "Debug" the error is located in line:
    DataEnvironement1.Command1 mystr1
    at the object DataEnvironment

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Re: VB Data Report Open

    I have the following code:

    DataEnvironment1.Command1_Grouping mystr1
    DataReport1.Show

    and when this is executed for the first time I get the report and everything is ok.
    when I close the report and try to show another report (with a different mystr1) I get the error:
    "Run-time error 3705: Operation is not allowed when the object is open"

    How can I close the object: ataEnvironment1.Command1_Grouping???

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    111

    Re: VB Data Report Open

    I meant the object:
    DataEnvironment1.Command1_Grouping???

    sorry

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