RunCommand Method Example

The following example uses the RunCommand method to open the Options dialog box (available by clicking Options on the Tools menu):

Function OpenOptionsDialog() As Boolean
    On Error GoTo Error_OpenOptionsDialog
    DoCmd.RunCommand acCmdOptions
    OpenOptionsDialog = True

Exit_OpenOptionsDialog:
    Exit Function

Error_OpenOptionsDialog:
    MsgBox Err & ": " & Err.Description
    OpenOptionsDialog = False
    Resume Exit_OpenOptionsDialog
End Function