Hello! I have created a custom sub that I want to set for the OnClick event
of several buttons on my form. I don't want to have to define so many event
Subs just to have them each contain a call to my Sub. My Sub is named
FindIt and I have tried setting the event property to: FindIt, FindIt(),
=FindIt, and =FindIt().
I believe there is a way, any hints?
Thanks 100x,
Joe
ruthness - 25 Jan 2005 18:30 GMT
you can create that sub findit() in a module and call it from your
button_onclick.
it works the same way.
> Hello! I have created a custom sub that I want to set for the OnClick
> event of several buttons on my form. I don't want to have to define so
[quoted text clipped - 6 lines]
> Thanks 100x,
> Joe
PC Datasheet - 25 Jan 2005 19:34 GMT
Put your sub in a module under the Modules tab in the database window and
call it with =FindIt().
BTW, your sub should look like:
Sub FindIt()
<Your Code>
End Sub
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
resource@pcdatasheet.com
www.pcdatasheet.com
> Hello! I have created a custom sub that I want to set for the OnClick event
> of several buttons on my form. I don't want to have to define so many event
[quoted text clipped - 6 lines]
> Thanks 100x,
> Joe
John Vinson - 25 Jan 2005 19:45 GMT
>Hello! I have created a custom sub that I want to set for the OnClick event
>of several buttons on my form. I don't want to have to define so many event
>Subs just to have them each contain a call to my Sub. My Sub is named
>FindIt and I have tried setting the event property to: FindIt, FindIt(),
>=FindIt, and =FindIt().
Make it a Function instead of a Sub and use the last of these options.
John W. Vinson[MVP]
Joseph Misko - 25 Jan 2005 21:03 GMT
Totally GREAT !!! This is exactly what I wanted. I thought I had seen this
before, but just couldn't get it. You saved me a bunch of work.
Thanks again,
Joe
>>Hello! I have created a custom sub that I want to set for the OnClick
>>event
[quoted text clipped - 7 lines]
>
> John W. Vinson[MVP]
Joseph Misko - 25 Jan 2005 21:02 GMT
Thanks everyone for your input!
Joe