|
-
Dec 23rd, 2005, 06:24 AM
#1
Thread Starter
Addicted Member
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 ?
-
Dec 23rd, 2005, 07:48 AM
#2
PowerPoster
Re: Very Strange Error in Datareport!!!
 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"
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|