Solved

Assign value to a RptTextBox in DataReport

Posted on 2000-02-24
5
1,625 Views
Last Modified: 2008-03-03
Hi !

I have a report (rptTest) with a rtpTextbox called "Fullname". I want, from my VB project, assign the value of a variable called "sCustomerName" to the rptTextbox in my datareport.

I DON'T WANT to use the DataReport Connection object, just simply assign the value !

I've tried this but it doesn't work.
"rptTest.Sections(3).Controls(1).Item.Text = sCustomerName" where Controls(1).Item is the rptTextbox.

Couls anyone help me with providing some code ?

Thanks to all !

0
Comment
Question by:sruel
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:gcs001
ID: 2554740
The Data Report's TextBox control is a data-bound control that can only display text from a database at run time.

You will thus have to make it a bound control by assigning values to the Data Member and Data Field properties.

You could try using the Label control instead and then assign the variable to the Caption property.

Regards.
Grant.
0
 
LVL 12

Expert Comment

by:roverm
ID: 2554753
try this:
rptTest.Sections(3).Controls("rptTextbox").Value = sCustomerName

Else, replace the textbox with a rptLabel, then use this code:

rptTest.Sections(3).Controls("lblMyLabel").Caption = sCustomerName

I use this al the time ! This works great!

D'Mzzl!
RoverM
0
 

Author Comment

by:sruel
ID: 2554880
I've tried with a rptLabel but i get the message "Invalid DataSource" on the .Show !!! What is going there in my case ???
0
 
LVL 12

Accepted Solution

by:
roverm earned 100 total points
ID: 2557134
U have to set a datasource for the entire DataReport, else nothing will work!
Just place a ADODC on a form and connect the DataReport to that!

D'Mzzl!
RoverM
0
 

Author Comment

by:sruel
ID: 2557551
It works ! Thanks to all !
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question