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 ?
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:
datareport1.sections("section1").contorls.[b][color=red]itme[/color][/b][color=red][/color]("label1").caption="HI"