473,383 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Can I change a Label in a form on the fly?

When a user selects a "Medium" in a form I have made, I would like to
change a Label on the form.

Can I change a label based on an update of a listbox?

This code does not work:

Case "Print"
Me.Description = "The print article "
Me.Measurement_Label = "Square Inches"
Case "Radio"
Me.Description = "The radio program "
Me.Measurement_Label = "Seconds"

The Description Text Box updates just fine, but not the label...

What am I missing?

Thanks,
Andrew

Jul 4 '06 #1
4 5703

"darnnews" <an************@gmail.comwrote in message
news:11**********************@v61g2000cwv.googlegr oups.com...
When a user selects a "Medium" in a form I have made, I would like to
change a Label on the form.

Can I change a label based on an update of a listbox?

This code does not work:

Case "Print"
Me.Description = "The print article "
Me.Measurement_Label = "Square Inches"
Case "Radio"
Me.Description = "The radio program "
Me.Measurement_Label = "Seconds"

The Description Text Box updates just fine, but not the label...

What am I missing?

Thanks,
Andrew

Jul 4 '06 #2
You could change the label to a text box if it won't let you update a label.

Linda

"darnnews" <an************@gmail.comwrote in message
news:11**********************@v61g2000cwv.googlegr oups.com...
When a user selects a "Medium" in a form I have made, I would like to
change a Label on the form.

Can I change a label based on an update of a listbox?

This code does not work:

Case "Print"
Me.Description = "The print article "
Me.Measurement_Label = "Square Inches"
Case "Radio"
Me.Description = "The radio program "
Me.Measurement_Label = "Seconds"

The Description Text Box updates just fine, but not the label...

What am I missing?

Thanks,
Andrew

Jul 4 '06 #3
"darnnews" <an************@gmail.comwrote in
news:11**********************@v61g2000cwv.googlegr oups.com:
When a user selects a "Medium" in a form I have made, I would
like to change a Label on the form.

Can I change a label based on an update of a listbox?
Yes
This code does not work:

Case "Print"
Me.Description = "The print article "
Me.Measurement_Label = "Square Inches"
Case "Radio"
Me.Description = "The radio program "
Me.Measurement_Label = "Seconds"

The Description Text Box updates just fine, but not the
label...

What am I missing?
The property in a label that needs changing is the .Caption
property. unlike the .Value property of a textbox, it is not
default and MUST be specified.
Me.Measurement_Label.caption = "Square Inches" will work

>
Thanks,
Andrew


--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jul 4 '06 #4
the default property of a textbox control in a form is Value, so when your
code reads

Me.Description = "The print article "

the actual code that's executed is

Me.Description.Value = "The print article "

a label control does not have a default property. to change the Caption
property of a label, you need to declare it explicitly in the code, as

Me.Measurement_Label.Caption = "Seconds"

hth
"darnnews" <an************@gmail.comwrote in message
news:11**********************@v61g2000cwv.googlegr oups.com...
When a user selects a "Medium" in a form I have made, I would like to
change a Label on the form.

Can I change a label based on an update of a listbox?

This code does not work:

Case "Print"
Me.Description = "The print article "
Me.Measurement_Label = "Square Inches"
Case "Radio"
Me.Description = "The radio program "
Me.Measurement_Label = "Seconds"

The Description Text Box updates just fine, but not the label...

What am I missing?

Thanks,
Andrew

Jul 4 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sjaakie Helderhorst | last post by:
Hi there, I created my own user control (myControl) containing: myCaption - docked top myGrid - docked.fill (datasource: myDataset) myPanel - docked bottom This control is added to the form:...
6
by: Roger Ries via DotNetMonster.com | last post by:
I'm trying to change the text in a label from another form. lblInfo.Text = "ABC" Works for the form your currently in but how the heck do you change that label information from another form. ...
5
by: Luis Ramos | last post by:
Hello, How do i change a label in another form from another one? in vb6 i use to do this: form1: private sub label1_change() form2.label1.caption="hgghjghjg" ' and the label in form2 is...
4
Atran
by: Atran | last post by:
Is there anyway to Change My Form Model? Mac Model, Linux Model..............................
4
by: Henrootje | last post by:
I have a REPORT with in it a subFORM Now I have this label (lblMonth) that I want to change. How should I do this? What would be the proper event to do this? The lblMonth should contain the...
1
by: zion | last post by:
Hello, How can I change label caption on page load ? Thanks
2
by: satishnandigam | last post by:
Hi all, I am new to c#. Can any one help to how to change the form name in c#. Thanks In Advance. N.Satish
1
by: Anwesha | last post by:
Hi, i have a problem while working with .net 2005. i have a situation where i have to change the form id which takes 'form1' by default. it donot allow me to change the id form the property...
3
by: saskoPython | last post by:
Hello, I go thrugh number of tutorials and steel can't find one simple thing (or I can't understand how to do this). My question is this: if we make "any" function like this: def myfunc():...
7
by: Jesse Jones | last post by:
Any ideas on how to send info from one form into another domain or how to write a default value for a new user's password with a formula? Here's what I'm trying to do: design my database so that...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.