Solved

Dynamically change value in textbox

Posted on 2002-03-05
8
245 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
8 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
What don't you update the DataSource of Data Report??
0
 
LVL 49

Expert Comment

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

Expert Comment

by:SirNick
Comment Utility
Hi chwankok
Try

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

0
 

Author Comment

by:chwankok
Comment Utility
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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 49

Expert Comment

by:Ryan Chong
Comment Utility
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 20 total points
Comment Utility
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
Comment Utility
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
Comment Utility
hi raama16, If what you said true, i will not waste more time on this. Thank you. =)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

744 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now