PearlGI
09-03-2001, 08:00 AM
Does anyone know the correct syntax to get the event property EventProcPrefix to work? I can't find the correct object to use.
The code I need is something like this:
Sub Cell59_Change()
myFunction(EventProcPrefix)
End Sub
Function myFunction(strProc as String)
..
{code}
..
End Function
What object does the EventProcPrefix property need to relate to?
Fornatian
09-03-2001, 10:14 AM
This worked for me. I put a command button on with this code behind:
Private Sub Command9_Click()
MsgBox Me.ActiveControl.EventProcPrefix
End Sub
This returned 'Command9'
I then copied the button and called
Private Sub Command10_Click()
Command9_Click
End Sub
This returned 'Command10'
I haven't used that property before and don't envisage needing to use it again because if it's the active control you want the name of you can just use Me.ActiveControl.Name
I don't see a purpose for it - can someone enlighten me?
Ian
PearlGI
09-03-2001, 10:26 AM
By using this property you can tell which Event_Procedure has called a function. Useful if you have a function that can be called by a number of Event_Procedures and you need to know which procedure the call came from (this negates the need to pass a parameter to the function).
Anyway, thanks for your help.
Cheers.
[This message has been edited by PearlGI (edited 09-03-2001).]