Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is it possible to change a db's options from code?

Status
Not open for further replies.

THEGREEK

Technical User
Aug 17, 2000
51
CA
Hi,

I was wondering if it was possible to change for example under tools, options... I want to change under the 'Keyboard' Tab - 'Behaviour when entering field option group' to always be "GO TO END OF FIELD". Is this even possible, if so can i get a sample piece of code to illustrate this.

Thanks in advance,
THEGREEK
 
The Access online Help for GetOption and SetOption will show you examples of how to do this. For example,
Code:
Application.SetOption "Move After Enter", 2
will cause Access to move to the next record when the Enter key is pressed.

Also, Textbox controls have a property called "Enter Key Behavior" that you can change to allow the Enter key to go to a new text line instead of the next control on the form.
 
here's a snippet of what's possible. bunches is remmed out.


'' Set Application Options and Toolbars ''
Application.SetOption "ShowWindowsInTaskbar", False
Application.SetOption "Show Hidden Objects", False
Application.SetOption "Show System Objects", False
Application.SetOption "Provide Feedback With Sound", False
Application.SetOption "Show Values Limit", 10000
Application.SetOption "Move After Enter", 1
Application.SetOption "Behavior Entering Field", 0
Application.SetOption "Arrow Key Behavior", 1
Application.SetOption "Cursor Stops at First/Last Field", True
'added in v0.92.6
'Application.SetOption "Status Bar", False 'its not status bar, its something else
Application.SetOption "Default find/replace behavior", 1

DoCmd.ShowToolbar "Alignment and Sizing", acToolbarNo
DoCmd.ShowToolbar "Clipboard", acToolbarNo
DoCmd.ShowToolbar "Database", acToolbarNo
DoCmd.ShowToolbar "Filter/Sort", acToolbarNo
DoCmd.ShowToolbar "Form Design", acToolbarNo
DoCmd.ShowToolbar "Form View", acToolbarNo
DoCmd.ShowToolbar "Formatting (Datasheet)", acToolbarNo
DoCmd.ShowToolbar "Formatting (Form/Report)", acToolbarNo
DoCmd.ShowToolbar "Formatting (Page)", acToolbarNo
DoCmd.ShowToolbar "Macro Design", acToolbarNo
DoCmd.ShowToolbar "Menu Bar", acToolbarNo
DoCmd.ShowToolbar "Page Design", acToolbarNo
DoCmd.ShowToolbar "Page View", acToolbarNo
DoCmd.ShowToolbar "Print Preview", acToolbarNo
DoCmd.ShowToolbar "Query Datasheet", acToolbarNo
DoCmd.ShowToolbar "Query Design", acToolbarNo
DoCmd.ShowToolbar "Relationship", acToolbarNo
DoCmd.ShowToolbar "Report Design", acToolbarNo
' DoCmd.ShowToolbar "Shortcut Menus", acToolbarNo
DoCmd.ShowToolbar "Source Code Control", acToolbarNo
DoCmd.ShowToolbar "Table Datasheet", acToolbarNo
DoCmd.ShowToolbar "Table Design", acToolbarNo
DoCmd.ShowToolbar "Toolbox", acToolbarNo
DoCmd.ShowToolbar "Utility 1", acToolbarNo
DoCmd.ShowToolbar "Utility 2", acToolbarNo
DoCmd.ShowToolbar "Web", acToolbarNo
' DoCmd.ShowToolbar "RunCard", acToolbarNo
DoCmd.ShowToolbar "GeneralMenu", acToolbarYes

'SetStartupProperties added in v0.92.6
'Const DB_Text As Long = 10
'Const DB_Boolean As Long = 1
'ChangeProperty "StartupForm", DB_Text, "Customers"
'ChangeProperty "StartupShowDBWindow", DB_Boolean, False
'ChangeProperty "StartupShowStatusBar", DB_Boolean, False
'ChangeProperty "AllowBuiltinToolbars", DB_Boolean, False
'ChangeProperty "AllowFullMenus", DB_Boolean, True
'ChangeProperty "AllowBreakIntoCode", DB_Boolean, False
'ChangeProperty "AllowSpecialKeys", DB_Boolean, True
'ChangeProperty "AllowBypassKey", DB_Boolean, True
Dim intX As Integer
intX = AddAppProperty("AppTitle", DB_Text, "xxxxxxx Database " & gdbVersion)
intX = AddAppProperty("AppIcon", DB_Text, "d:\icon.ico")
'Application.RefreshTitleBar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top