[RESOLVED] Pls. Help with DataReport1 - "Invalid Data Source"
Hello Everyone,
Im trying to to assign a value, lets say "This is my text", to a label1 on my
datareport1, and it raised an error "Invalid Data Source"...
my code here
Code:
DataReport1.Sections("Section2").Controls("Label1").Caption = "This is my Text"
even this also raised the same error
Code:
DataReport1.Sections("Section2").Controls("Label1").Caption = form1.Label1.Caption
How could i change the caption of Label1 in DataReport1 at runtime???
No, I dont want that DataReport1.DataSource be assign to any database, i only want that Label1.Caption, or any controls therein to be change at runtime, is that possible?
Thank you for any reply...
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Are you sure its a label and not a textbox? Did you set the labels before opening the report?
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Yap, im sure its a Label, and i put it already on the datareport before opening it...
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Are you referencing an instance of the report, or the report itself?
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Im referencing an object on the DataReport1 which is Label1(RptLabel) which is on Page Header(Section2) and want to change its caption during runtime...
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Did you do this?
Code:
Dim repRef As MyDateReport1
Set repRef = New MyDataReport1
That ensures your working with an unopened data report. http://www.vbforums.com/showthread.p...ataenvironment
Or did you reference MyDataReport1 directly?
Re: Pls. Help with DataReport1 - "Invalid Data Source"
I usually do in the datareport_initialize event.
Code:
rptAdjust_Invoices.Sections("Invtemp_Header").Controls.Item("lblCsz").Caption = "some text"
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Did you notoce the syntax is different than yours? Text boxes and labels are different in the way you assign data.
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Ok, Thank you guys, i figure it now...