|
-
Dec 16th, 2007, 09:03 PM
#1
Thread Starter
Member
[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...
I'm maybe a noob now, but with your help, i would become an expert someday 
-
Dec 16th, 2007, 09:16 PM
#2
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?
-
Dec 16th, 2007, 09:31 PM
#3
Thread Starter
Member
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...
I'm maybe a noob now, but with your help, i would become an expert someday 
-
Dec 16th, 2007, 09:51 PM
#4
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Are you referencing an instance of the report, or the report itself?
-
Dec 16th, 2007, 10:41 PM
#5
Thread Starter
Member
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...
I'm maybe a noob now, but with your help, i would become an expert someday 
-
Dec 16th, 2007, 11:06 PM
#6
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?
-
Dec 17th, 2007, 01:33 AM
#7
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"
-
Dec 17th, 2007, 08:29 AM
#8
Re: Pls. Help with DataReport1 - "Invalid Data Source"
-
Dec 17th, 2007, 03:17 PM
#9
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.
-
Dec 23rd, 2007, 02:13 AM
#10
Thread Starter
Member
Re: Pls. Help with DataReport1 - "Invalid Data Source"
Ok, Thank you guys, i figure it now...
I'm maybe a noob now, but with your help, i would become an expert someday 
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
|