Code Examples

Page Set Up

acCmdPageSetup

This function opens the Page Set Up dialog box. It can only be run from a menu and not from an event on a form or a report.

See "Add a custom command that runs a Visual Basic function to a menu" in Help for more information on how to put this behind a menu item.

'***************** Code Start *******************
' Code by Terry Wickenden

Function TerryPageSetUp()
  On Error GoTo ErrTestPage

  DoCmd.RunCommand acCmdPageSetup
  Exit Function

ErrTestPage:

  Select Case Err
    Case 2501
      'Do nothing Cancel was selected
    Case Else
      'Unable to process
      MsgBox Err & vbCrLf & vbCrLf & Err.Description, vbCritical, "Error Message"
      Exit Function
  End Select

End Function

'****************** Code End ********************

© 1998 - 2011 Terry Wickenden TKW Design Site developed maintained and hosted by TKW Design. This site is best viewed at 1024 x 768. Optimised for Firefox.