G
Guest
Thanks for taking the time to read my question.
I want to use labels for buttons instead of buttons. That way when the mouse
moves over the button, I can change its appearance.
That being said... instead of having code on all my label buttons, I'd like
to have a function or public sub that can take in the name of the control,
and adjust accordingly. I can't seem to get this to work. I can make it
work on the code for the form, but not in a public sub or function.
Here is what I have tried.
Click On The Label Button:
'Code on Form
Private Sub cmdOpenClientDatalbl_MouseDown()
LBLToButtonDown ("cmdOpenClientDatalbl")
End Sub
'Code in Module
Function LBLToButtonDown(TheControlName As String)
Dim ctl As Control
With ctl(TheControlName)
.SpecialEffect = 2
.BackStyle = 1
End With
End Function
Any ideas on how I can affect the settings of a control on a form, from a
function or public sub by passing the name of the control.
Thanks,
Brad
I want to use labels for buttons instead of buttons. That way when the mouse
moves over the button, I can change its appearance.
That being said... instead of having code on all my label buttons, I'd like
to have a function or public sub that can take in the name of the control,
and adjust accordingly. I can't seem to get this to work. I can make it
work on the code for the form, but not in a public sub or function.
Here is what I have tried.
Click On The Label Button:
'Code on Form
Private Sub cmdOpenClientDatalbl_MouseDown()
LBLToButtonDown ("cmdOpenClientDatalbl")
End Sub
'Code in Module
Function LBLToButtonDown(TheControlName As String)
Dim ctl As Control
With ctl(TheControlName)
.SpecialEffect = 2
.BackStyle = 1
End With
End Function
Any ideas on how I can affect the settings of a control on a form, from a
function or public sub by passing the name of the control.
Thanks,
Brad