[AccessD] A2K: Get Control's Label Name

Brock, Christian T, HRC-Alexandria Christian.Brock at hoffman.army.mil
Fri Jun 11 09:10:03 CDT 2004


Attached labels are in a control's own control collection.  I use this code
to change a control's label. You can modify it to extract the caption and
other properties.

Public Function ModifyControlsLabel(pctl As Control, pstrNewName As String)
Dim ctl As Control
    For Each ctl In pctl.Controls
        If ctl.ControlType = acLabel Then
            ctl.Name = "lbl" & pstrNewName
        End If
    Next ctl
End Function

Christian Brock
APT Program
DSN 221-1936
703-325-1936



-----Original Message-----
From: Darren DICK [mailto:d.dick at uws.edu.au] 
Sent: Friday, 11 June 2004 00:17
To: AccessD List
Subject: [AccessD] A2K: Get Control's Label Name


Hello all
When I drop a control onto a form (say a text Box)
The system usually it something like Text0 or text1 etc and it also
creates its very own label with similar names.

If I know the name of a control can I get it's label name and or caption or
any such properties?

eg Me.txtMyTextBox.ChildLabel.caption

Many thanks in advance

Darren

-- 
_______________________________________________
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