[AccessD] Find Label text attached to Text Box

Dan Waters dwaters at usinternet.com
Wed Mar 30 18:30:53 CST 2005


Gregg,

This is an example you can start with.


Private Sub LabelExample()
On Error GoTo EH

    Dim stgTextComboBoxName As String
    Dim stgLabelName As String
    Dim stgLabelCaption As String
    Dim ctl As Control
 
    For Each ctl In Me.Controls
        stgTextComboBoxName = ctl.Name
        If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
            stgLabelCaption = ctl.Controls(0).Caption
            stgLabelName = ctl.Controls(0).Name
            MsgBox "The Text or ComboBox name is: " & stgTextComboBoxName _
                & vbCrLf & vbCrLf _
                & "The Label name is: " & stgLabelName _
                & vbCrLf & vbCrLf _
                & "The Label caption is: " & stgLabelCaption
        End If
    Next

    Exit Sub

EH:

End Sub


Dan Waters
ProMation Systems, Inc.


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gregg
Sent: Wednesday, March 30, 2005 6:07 PM
To: Access Developers discussion and problem solving
Subject: [AccessD] Find Label text attached to Text Box

If you have a Text Box with an attached Label is there some way to find the
Label Text when you only know the Text Box Name?
--
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