Spacing Options
acCmdHorizontalSpacingMakeEqual, acCmdHorizontalSpacingIncrease, acCmdHorizontalSpacingDecrease, acCmdVerticalSpacingMakeEqual, acCmdVerticalSpacingIncrease, acCmdVerticalSpacingDecrease
This routine allows you to display a 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 "SpacingTools"
- Add the required buttons to the toolbar.
- Name the buttons as appropriate. Set the on action property to "=ControlSpacing("HEqual")" etc.
- Add the ControlSpacing function to a module
- Display the Toolbar "SpacingTools" 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.
Function ControlSpacing(SpaceType As String)
'Accepts a string to determine type of spacing required
Dim strCheck As String
strCheck = UCase(SpaceType)
Select Case strCheck
Case "HEQUAL"
'make the items equally spaced horizontally
DoCmd.RunCommand acCmdHorizontalSpacingMakeEqual
Case "HINCREASE"
'increase space between items horizontally
DoCmd.RunCommand acCmdHorizontalSpacingIncrease
Case "HDECREASE"
'decrease space between the items horizontally
DoCmd.RunCommand acCmdHorizontalSpacingDecrease
Case "VEQUAL"
'make the items equally spaced vertically
DoCmd.RunCommand acCmdVerticalSpacingMakeEqual
Case "VINCREASE"
'increase space between items vertically
DoCmd.RunCommand acCmdVerticalSpacingIncrease
Case "VDECREASE"
'decrease space between the items vertically
DoCmd.RunCommand acCmdVerticalSpacingDecrease
End Select
End Function
'****************** Code End ********************