Subform events

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a tab control with subforms on the tabs. I would like to execute code
when the tab is clicked.
I tried putting code on the "On Click" event for the tab but get no results.
The "On Click" event calls a public sub on the subform:

Private Sub TabPageName_Click()
Me.subformcontrolname.form.procedurename
End Sub

Also, I would like to run code (save input data) when exiting the subform
and don't get results with "On exit" event of the subform.

Should these two events work to trigger code? If I know that much, then I
can try to figure out what it is in the code that doesn't fly.
Thanks!!
 
smk23 said:
I have a tab control with subforms on the tabs. I would like to execute code
when the tab is clicked.
I tried putting code on the "On Click" event for the tab but get no results.
The "On Click" event calls a public sub on the subform:

Private Sub TabPageName_Click()
Me.subformcontrolname.form.procedurename
End Sub

Also, I would like to run code (save input data) when exiting the subform
and don't get results with "On exit" event of the subform.

Should these two events work to trigger code? If I know that much, then I
can try to figure out what it is in the code that doesn't fly.


Changing to a different tab triggers the tab control's
Change event.

Since the Change event is accociated with the tab control,
not each page, your code could be something like:

Select Case Me.tabcontrol.Value
Case 1
Me.subform1.Form.procA
Case 2
Me.subform2.Form.procB
. . .
End Select

As for saving the data, that is automatic for bound forms,
so you don't have to do anything.
 
Back
Top