?
Solved

Dynamically change value in textbox

Posted on 2002-03-05
8
Medium Priority
?
256 Views
Last Modified: 2008-02-01
The code below dynamically change the a label in data Report. How to dynamically change a textbox data in Data Report?


Me.Sections("section1").Controls("label1").Caption= "Hello"

0
Comment
Question by:chwankok
[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
8 Comments
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6841051
What don't you update the DataSource of Data Report??
0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6841052
> What don't you update ..
"What" should be "Why"
0
 
LVL 3

Expert Comment

by:SirNick
ID: 6841055
Hi chwankok
Try

Me.Sections("section1").Controls("Text1").Text = "Hello"

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:chwankok
ID: 6841072
SirNick,
It does not work and i tried this too
Me.Sections("section1").Controls.Item("Text1").Text = "Hello"

ryancys,
i have an if condition to determine what value to display.  

0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6841137
Isn't it what your display show in "Detail Section" ? What you intend to change > a field's value or free text value?

regards
0
 
LVL 1

Accepted Solution

by:
raama16 earned 60 total points
ID: 6841213
Sorry ! You can not change dynamically the value of text box in the data report but you can change the label caption !!! I think it is the drawback of Data report !!!

Regards,
Ramachandra
0
 
LVL 1

Expert Comment

by:jdesharnais
ID: 6842167
you can do this in the sql statement.
what database do you use?
for access db use the iif and or switch statement
IIf(expr, truepart, falsepart)

ex select iif(fieldA= 1,"Red","Green") as myfield from tablea

you may use the switch statement.
Switch(expr-1, value-1[, expr-2, value-2 … [, expr-n,value-n]])

ex select Switch([fielda]="1","one",[fielda]="2","two"",[fielda]>"2","other") AS myfield , FROM tablea

The problem with the switch statement is that the function returns a null if none of the conditions are found.  And sometimes it is difficult to have an other statement in this case use the iif and the switch together

SELECT iif(Switch([fielda]="1","one",[fielda]="2","two") is not null,Switch([fielda]="1","one",[fielda]="2","two"),"BLANKS" )AS myfield FROM tablea

0
 

Author Comment

by:chwankok
ID: 6843085
hi raama16, If what you said true, i will not waste more time on this. Thank you. =)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

752 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