Solved

Assign value to a RptTextBox in DataReport

Posted on 2000-02-24
5
1,650 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…

749 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