Dynamically change value in textbox

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"

chwankokAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
What don't you update the DataSource of Data Report??
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
> What don't you update ..
"What" should be "Why"
SirNickCommented:
Hi chwankok
Try

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

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

chwankokAuthor Commented:
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.  

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
Isn't it what your display show in "Detail Section" ? What you intend to change > a field's value or free text value?

regards
raama16Commented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jdesharnaisCommented:
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

chwankokAuthor Commented:
hi raama16, If what you said true, i will not waste more time on this. Thank you. =)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.