[AccessD] Grab a text box's label's caption in code.

John W. Colby jwcolby at colbyconsulting.com
Tue Jan 18 20:18:25 CST 2005


While that works a generic solution that will work for any control is to
cycle through the controls collection looking for the controltype acLabel.
Controls such as the option group can have multiple controls in it's
collection and the label may or may not be at position 0.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Lonnie Johnson
Sent: Tuesday, January 18, 2005 8:20 PM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] Grab a text box's label's caption in code.


Thanks Dan this is what I was looking for and the one that works best ofr
me.

Dan Waters <dwaters at usinternet.com> wrote:Lonnie,

Each textbox has a Controls collection. It turns out that the only control
in that collection is the label. I think if you type in:

stgCaption = txtBox.Controls(0).Caption

then you'll get the caption. 

HTH,
Dan Waters
ProMation Systems

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Lonnie Johnson
Sent: Tuesday, January 18, 2005 3:08 PM
To: AccessD solving'
Subject: [AccessD] Grab a text box's label's caption in code.

Can I somehow call the name of a textbox and get the caption of it's label?

I don't see a label property for a textbox.

Just curious. 



May God bless you beyond your imagination!
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
Visit me at ==> http://www.prodev.us












---------------------------------
Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




May God bless you beyond your imagination!
Lonnie Johnson
ProDev, Professional Development of MS Access Databases
Visit me at ==> http://www.prodev.us





 





		
---------------------------------
Do you Yahoo!?
 Yahoo! Mail - Find what you need with new enhanced search. Learn more.
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com






More information about the AccessD mailing list