Trigger Subform Event

tuna

Registered User.
Local time
Today, 22:23
Joined
Mar 31, 2010
Messages
27
Hi, how can I trigger an event in a subform? e.g. if I have a hyperlink in the subform, I can access/execute the onclick event in the main form?

Thanks
 
Sorry, that was badly phrased. What I mean to say is that if my subform has a button, say cmdSub, I would like to be able to execute the event procedure cmdSub_Click() (or indeed cmdSub_<any event>) from the main form that contains the subform.

Essentially, I would like to put controls on the main form that mirrors controls on the subform. You may think this seems ludicrous but it's because I have multiple subforms in a tab control, each on a page. I have a main page where I would like to give the user quick access to frequently used functions within each subform, but I don't really want to duplicate a lot of code - just make use of the existing code.

Thanks
 
You could simply copy and paste the code behind the current button into new buttons, making the appropriate adjustments as necessary.

Alternately you could turn the code behind the current button into a Public Function and call that on any buttons on which you wish to utilise the code.
 

Users who are viewing this thread

Back
Top Bottom