Hi Kent,
is the form with the diagram on a tab control?
Tab controls have an event called the Change event.
Assume you have a tab control called tabOrders with 2 pages
Assume that frmDiagram is on the 2nd page of tabOrders.
Assume that FrmDiagram is the name of the subform control and that
FrmDiagram is the name of the form inside the subform control.
Note: the name of the subform control is not always the same as the name of
the form inside the subform control.
To refer to a control on a subform you need to use syntax like this:
Forms![MainFormName]!Form.[NameOfControlOnSubformInsideSubformControl]
You would use code something like this:
Private Sub tabOrders_Change
If Me.tabOrders = 1 then
Forms![FrmGrund1]!form.[FrmDiagram].Requery
End If
End Sub
If the tab control is on the 1st page, tabOrders has a value of 0.
If the tab control in on the 2nd page, tabOrders has a value of 1.
Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
Kent J said:
Hi all,
I have diagram on a subform and I want the diagram to be updated when I
click on the Tab. Something like:
========================================
Private Sub Diagram_1_Click()
Forms![FrmGrund1]![FrmDiagram].Requery
End Sub
========================================
What have I missed?
Kent J.