Results 1 to 2 of 2

Thread: Very Strange Error in Datareport!!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    150

    Very Strange Error in Datareport!!!

    I placed a label on a datareport

    Then I typed the following command

    Private sub Command1_click()

    Dim rs as new adodb.recordset
    set rs=cm.execute("select sysdate from dual")
    set datareport1.datasource=rs

    datareport1.sections("section1").contorls.itme("label1").caption="HI"
    datareport1.show

    I run the program and I follow what it is doing by click on F8 , and every thing seams to be allright , I see the a report with the word HI in it.


    Now when I click on the button , without breaking the code or pressing F8 , I get an error message saying ( Operation is not allowed when the object is closed!)


    What is going on , can someone explain this to me ?

  2. #2
    PowerPoster
    Join Date
    Apr 2005
    Location
    Debug.Print
    Posts
    3,885

    Re: Very Strange Error in Datareport!!!

    Quote Originally Posted by bomayed
    I placed a label on a datareport

    Then I typed the following command

    Private sub Command1_click()

    Dim rs as new adodb.recordset
    set rs=cm.execute("select sysdate from dual")
    set datareport1.datasource=rs

    datareport1.sections("section1").contorls.itme("label1").caption="HI"
    datareport1.show

    I run the program and I follow what it is doing by click on F8 , and every thing seams to be allright , I see the a report with the word HI in it.


    Now when I click on the button , without breaking the code or pressing F8 , I get an error message saying ( Operation is not allowed when the object is closed!)


    What is going on , can someone explain this to me ?
    first you need to dim and set the recordset and connection to the database, then you open the recordset, do your sql query and then close the recordset and connection to the database. secondly, this like has a typo:
    VB Code:
    1. datareport1.sections("section1").contorls.[b][color=red]itme[/color][/b][color=red][/color]("label1").caption="HI"

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