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!

Which Label did I click on?

Status
Not open for further replies.

ztm

IS-IT--Management
Jul 19, 2001
34
US
I'm working on a project that has a bunch of labels in an array on a form. When I click on one, I want to execute the same code as I do for each one (hence, the array) but I can't figure out how to tell which label I clicked on once the code starts?

Any help would be appreciated..Thanks.
 
Personally, I would put the labels in a control array (if they aren't already), then you'd just have to write code to examine the index property of each label.

Buffer0verflow
 
Index!! That was it! Thanks for the quick response. I did have the labels in a control array, but just couldn't make it work. I ended up with

Private Sub labelarray_Click(Index As Integer)
labelnumber = labelarray(index)
End Sub

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top