Event Sink

nathansav

Registered User.
Local time
Today, 15:49
Joined
Jul 28, 2010
Messages
114
Hi,

I am trying to create an event sink, to handle the on_enter event on my form, for each of the (approx 20) text boxes on the form, to have a common event. I have looked at a few examples, but can not get them to work.

Can anyone advise.

Many thanks.
 
In order to do event sinks, you will be working with Classes.

I tried to attach a file from a few years ago, but it says it's an invalid file type.
So here's a link that may give you some ideas.

http://www.databaseadvisors.com/newsletters/newsletter052002/0205CombiningRaiseEvents .asp

You can google "raise events john colby data base" and get more links for John.

I can't find the sample I'm looking for, but here's another link
http://flylib.com/books/en/3.150.1.116/1/

NOTE: I was able to get the article from my H drive and create a zip file which I have attached. The article goes through an example of events.
 

Attachments

Last edited:
While I have no idea what an event sink is, based on your post you want the same piece of code run for each control event?

If that's the case then one option is to put the common code in a function and call the function from each control event.

Of course, as I don't know what an event sink is that may not actually do what you want!
 
Many thanks J Draw it worked beautifully, i have now got a bit carried away with it, and i am sinking everything. One thing that is puzzling me, i want to do this on the detail click of a form, i have done the following and it works on the form click, but not the detail clicking.

Dim WithEvents oForm As Form
Public Sub init(lForm As Form)
Set oForm = lForm
oForm.OnClick = "[Event Procedure]"
End Sub
Private Sub oForm_Click()
MsgBox "Clicked"
End Sub
 

Users who are viewing this thread

Back
Top Bottom