By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,164 Members | 1,018 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,164 IT Pros & Developers. It's quick & easy.

Event Caller Question

P: n/a
Hi to everybody,

I have this problem

I attach an event to a group of control from code:
Set Frm = Fom_Test
for ii = 1 to 100
Frm.Controls("Label" & ii).OnClick = "=Event_Click()"
Next

Event_Click() is on form Form_Test

Sub Event_Click()
' code to apply to label caller
End Sub

when the event "raise" I need to know wich object (label) call the event.

Someone could help me?

thanks in advance

Luca
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
try screen.activecontrol
Pachydermitis

Nov 13 '05 #2

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Put a parameter in the Sub and in the call. E.g.:

Frm.Controls("Label" & ii).OnClick = "=Event_Click(" & ii & ")"

Sub Event_Click(bytLabelID As Byte)

Select Case bytLabelID
Case 1
' do something
Case 2
' do something else
' ... etc. ...
End Select

End Sub
--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQlrVRYechKqOuFEgEQL2xwCgsB2oAXQhHAdF8xyDyJDXiG 8YsuUAn144
r3cmG8XaL42Z0w7aEfq/mKDR
=Hxoh
-----END PGP SIGNATURE-----

Luca Giannoni wrote:
Hi to everybody,

I have this problem

I attach an event to a group of control from code:
Set Frm = Fom_Test
for ii = 1 to 100
Frm.Controls("Label" & ii).OnClick = "=Event_Click()"
Next

Event_Click() is on form Form_Test

Sub Event_Click()
' code to apply to label caller
End Sub

when the event "raise" I need to know wich object (label) call the event.

Someone could help me?

thanks in advance

Luca

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.