Design Toolbar Extra
acCmdPageHdrFtr, acCmdPageNumber, acCmdApplyDefault, acCmdBringToFront, acCmdSendToBack
This routine allows you to display toolbar to assist in the design of a Form or Report. There are a number of steps required to ensure this example works.
- Create a toolbar called "FormsTools"
- Add 5 buttons to the toolbar in the following order. (These must be the first 5 buttons on the toolbar for this to work as coded)
- Name the first button "Show/Hide Page Header" and set the on action property to "=TBFormTools(1)"
- Name the next button "Show Page Number" and set the on action property to "=TBFormTools(2)"
- Name the third button "Reset to Default" and set the on action property to "=TBFormTools(3)"
- Name the fourth button "Bring To Front" and set the on action property to "=TBFormTools(4)"
- Name the last button "Send to Back" and set the on action property to "=TBFormTools(5)"
- Add the code headed Toolbar Code to a module
- Display the Toolbar "FormTools" when in the design of a form or report
'***************** Code Start *******************
' This code was originally written by Terry Wickenden.
' It is not to be altered or distributed,
' except as part of an application.
' You are free to use it in any application,
' provided the copyright notice is left unchanged.
'=========Toolbar Code=============
Function TBFormTools(Index As Integer)
Select Case Index
Case 1 'Page header footer
DoCmd.RunCommand acCmdPageHdrFtr
Case 2 'Page number
DoCmd.RunCommand acCmdPageNumber
Case 3 'Re apply default
DoCmd.RunCommand acCmdApplyDefault
Case 4 'Bring to front
DoCmd.RunCommand acCmdBringToFront
Case 5 'Send to back
DoCmd.RunCommand acCmdSendToBack
End Select
End Function
'****************** Code End ********************