We're no longer updating this content regularly. Check the Microsoft Product Lifecycle for information about how this product, service, technology, or API is supported.
Set Options from Visual Basic [Access 2003 VBA Language Reference]
Article
10/17/2006
You can use the SetOption and GetOption methods to set and return option values in the Options dialog box from code. To view the Options dialog box, click Options on the Tools menu.
The following tables list the names of all options that can be set or returned from code and the tabs on which they can be found in the Options dialog box, followed by the corresponding string argument that you must pass to the SetOption or GetOption method.
Notes
If your database may run on a version of Microsoft Access for a language other than the one in which you created it, then you must supply the arguments for the GetOption and SetOption methods in English.
Some options are available only within a Microsoft Access database (.mdb) or Access project (.adp).
View Tab
Option text
String argument
Show, Status bar
Show Status Bar
Show, Startup Task Pane
Show Startup Dialog Box
Show, New object shortcuts
Show New Object Shortcuts
Show, Hidden objects
Show Hidden Objects
Show, System objects
Show System Objects
Show, Windows in Taskbar
ShowWindowsInTaskbar
Show in Macro Design, Names column
Show Macro Names Column
Show in Macro Design, Conditions column
Show Conditions Column
Click options in database window
Database Explorer Click Behavior
General Tab
Option text
String argument
Print margins, Left margin
Left Margin
Print margins, Right margin
Right Margin
Print margins, Top margin
Top Margin
Print margins, Bottom margin
Bottom Margin
Use four-year digit year formatting, This database
Four-Digit Year Formatting
Use four-year digit year formatting, All databases
Four-Digit Year Formatting All Databases
Name AutoCorrect, Track name AutoCorrect info
Track Name AutoCorrect Info
Name AutoCorrect, Perform name AutoCorrect
Perform Name AutoCorrect
Name AutoCorrect, Log name AutoCorrect changes
Log Name AutoCorrect Changes
Recently used file list
Enable MRU File List
Recently used file list, (number of files)
Size of MRU File List
Provide feedback with sound
Provide Feedback with Sound
Compact on Close
Auto Compact
New database sort order
New Database Sort Order
Remove personal information from file properties on save
Remove Personal Information
Default database folder
Default Database Directory
Edit/Find Tab
Option text
String argument
Default find/replace behavior
Default Find/Replace Behavior
Confirm, Record changes
Confirm Record Changes
Confirm, Document deletions
Confirm Document Deletions
Confirm, Action queries
Confirm Action Queries
Show list of values in, Local indexed fields
Show Values in Indexed
Show list of values in, Local nonindexed fields
Show Values in Non-Indexed
Show list of values in, ODBC fields
Show Values in Remote
Show list of values in, Records in local snapshot
Show Values in Snapshot
Show list of values in, Records at server
Show Values in Server
Don't display lists where more than this number of records read
Show Values Limit
Datasheet Tab
Option text
String argument
Default colors, Font
Default Font Color
Default colors, Background
Default Background Color
Default colors, Gridlines
Default Gridlines Color
Default gridlines showing, Horizontal
Default Gridlines Horizontal
Default gridlines showing, Vertical
Default Gridlines Vertical
Default column width
Default Column Width
Default font, Font
Default Font Name
Default font, Weight
Default Font Weight
Default font, Size
Default Font Size
Default font, Underline
Default Font Underline
Default font, Italic
Default Font Italic
Default cell effect
Default Cell Effect
Show animations
Show Animations
Show Smart Tags on Datasheets
Show Smart Tags on Datasheets
Keyboard Tab
Option text
String argument
Move after enter
Move After Enter
Behavior entering field
Behavior Entering Field
Arrow key behavior
Arrow Key Behavior
Cursor stops at first/last field
Cursor Stops at First/Last Field
Auto commit
Ime Autocommit
Datasheet IME control
Datasheet Ime Control
Tables/Queries Tab
Option text
String argument
Table design, Default field sizes - Text
Default Text Field Size
Table design, Default field sizes - Number
Default Number Field Size
Table design, Default field type
Default Field Type
Table design, AutoIndex on Import/Create
AutoIndex on Import/Create
Query design, Show table names
Show Table Names
Query design, Output all fields
Output All Fields
Query design, Enable AutoJoin
Enable AutoJoin
Query design, Run permissions
Run Permissions
Query design, SQL Server Compatible Syntax (ANSI 92) - This database
ANSI Query Mode
Query design, SQL Server Compatible Syntax (ANSI 92) - Default for new databases
Form/Report Design Rules, Invalid control properties
Invalid Control Properties Error Checking
Form/Report Design Rules, Common report errors
Common Report Errors Error Checking
Note If you are developing a database application, add-in, library database, or referenced database, make sure that the Error Trapping option is set to 2 (Break On Unhandled Errors) when you have finished debugging your code.
The value that you pass to the SetOption method as the setting argument depends on which type of option you are setting. The following table establishes some guidelines for setting options.
If the option is
Then the setting argument is
A text box
A string
A check box
A Boolean value — True (–1) or False (0)
An option button in an option group, or an option in a combo box or a list box
An integer corresponding to the option's position in the option group or list (starting with zero [0])