Code Examples

Preview A Number of Pages

acCmdPreviewOnePage, acCmdPreviewTwoPages, acCmdPreviewFourPages, acCmdPreviewEightPages, acCmdPreviewTwelvePages

This function is designed to be called from buttons behind a custom toolbar on a report. Set the On Action Property of the button to "=TBPreviewPage(X)" where X is 1, 2, 4, 8 or 12 and represents the number of pages to be previewed at once.

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

Function TBPreviewPage(intNumb As Integer)
  Select Case intNumb
    Case 1
      DoCmd.RunCommand acCmdPreviewOnePage
    Case 2
      DoCmd.RunCommand acCmdPreviewTwoPages
    Case 4
      DoCmd.RunCommand acCmdPreviewFourPages
    Case 8
      DoCmd.RunCommand acCmdPreviewEightPages
    Case 12
      DoCmd.RunCommand acCmdPreviewTwelvePages
  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.