Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Label Control

Status
Not open for further replies.

Mus986

Programmer
Mar 8, 2011
3
US
Hello,
I have a form with labels that represent each letter of the alphabet that I intend to use as a way of filtering a listbox. So far I have created a class module called clsSimple and a Procedure called basTest with a function called TestSimple and i'm able to pass the value of the label I click. I'm just not sure what to do on the form end without coding each label's click event to pass the label value. Thank you in advance.


clsSimple
Public Letter As String


Public Function TestSimple(sLetter As String)
Dim oSim As clsSimple
Set oSim = New clsSimple

oSim.Letter = sLetter

MsgBox oSim.Letter

End Function
 
Use a command button instead of a label if you can.
A label can not be the "active control"
Select all your command buttons at one time and in the event
type "= testSimple()". Do not select "[Event Procedure]".

Public Function TestSimple()
Dim oSim As clsSimple
Set oSim = New clsSimple
oSim.Letter = me.activecontrol.caption
MsgBox oSim.Letter
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top