Code Examples For RunCommand Constants

Change Tab Order

acCmdSelectForm, acCmdTabOrder

The following function displays just the Tab Order Dialog without actually displaying the form in design mode. It could be used from a toolbar to change the tab order without displaying the form in design view. The Select Form is not strictly necessary.

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

Function TBChangeTabOrder(strForm As String)

  'Avoid problems if cancel selected in Tab Order
  On Error Resume Next

  DoCmd.Echo False
  DoCmd.OpenForm "TestDesignForm", acDesign
  DoCmd.RunCommand acCmdSelectForm
  DoCmd.RunCommand acCmdTabOrder
  DoCmd.Close , , acSaveYes
  DoCmd.Echo True

End Function

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