Have a form that has 40 entries of a label and a text box with each label. When a label is double clicked in need to get the name of the lable in vba. I have tried this:
Private Sub Bay01_DblClick(Cancel As Integer)
EventSwitch = True
Dim fromCtl As String
fromCtl = Me.ActiveControl.Name
DoCmd.OpenForm "BaysFilled", , , , , , OpenArgs = fromCtl 'Pass name to dialogue box
EventSwitch = False
End Sub
This gives me the name of the textbox, not the name of the label, which is what I need to write the code in the dialogue box..
The name is text and is passed as text via OpenArgs.
EventSwich is a Boolian variable in a standard module.
Thanks in advance
jpl
Private Sub Bay01_DblClick(Cancel As Integer)
EventSwitch = True
Dim fromCtl As String
fromCtl = Me.ActiveControl.Name
DoCmd.OpenForm "BaysFilled", , , , , , OpenArgs = fromCtl 'Pass name to dialogue box
EventSwitch = False
End Sub
This gives me the name of the textbox, not the name of the label, which is what I need to write the code in the dialogue box..
The name is text and is passed as text via OpenArgs.
EventSwich is a Boolian variable in a standard module.
Thanks in advance
jpl