What is the syntax to automatically run code when multi-page page changes?

Private Sub <multipage name>_Change()
   If Me.<multipage name>.Value = <pg index under which code should run> Then
      <code to be run when page is activated>
   End If
End Sub
'example for multipage named "mtp"
Private Sub mtp_Change() 'called whenever active page in multipage changes
   If Me.mtp.Value = 1 Then 'if user opens the "Show Guest List" page
        Call loadGuestLists 'automatically runs this code
   End If
End Sub
Advertisements