UtterAccess HomeUtterAccess Wiki

Welcome Guest ( Log In | Register )

Custom Search
Edit Discussion
> Reference a control's label    
Reference a control's label

If you look at the member's of an Access.Control object in the Object Browser you will see that all controls have a Controls property.
Access controls that have a label attached to them will have one item in the Controls collection. That item, .Item(0), will be the label object
that is attached to the control.

Proof of concept

Dim lbl as Access.Label
Set lbl = ControlName.Controls.Item(0)

Debug.Print lbl.Caption

Caveat

If a control does not have an attached label, referencing .Controls.Item(0) will throw an error.

A related topic, attaching and detaching labels through Access's user interface can be found here: http://www.utteraccess.com/wiki/Labels:_Attach_And_Detach

Edit Discussion
Custom Search
Thank you for your support!
This page has been accessed 5,331 times.  This page was last modified 01:16, 21 March 2018 by mbizup. Contributions by Jack Leach and Ace  Disclaimers