473,496 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Event Caller Question

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
2 3058
try screen.activecontrol
Pachydermitis

Nov 13 '05 #2
-----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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
49551
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. ...
3
1934
by: James Dunkerley | last post by:
Hi, I am trying to create a class which downloads a web page in the background and then raises an event in the original thread in which it was created. This class is going to be the basis of a...
10
1505
by: localhost | last post by:
I have a static, thread-safe class with a DataSet as a property. When the class is instanced into an object, some callers add rows to a DataTable in the DataSet. Other callers read the DataSet. ...
7
1693
by: Michael D. Ober | last post by:
Is there anyway to raise an event from a class and require that any program using that class (not just inheritance) have an event handler for specific events in the class? In my case, some events...
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6991
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7373
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4583
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.