By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,856 Members | 1,986 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,856 IT Pros & Developers. It's quick & easy.

yet another question - how do I set error trapping to 2?

P: n/a
Hi Gurus

Does anyone know how I set the error trapping to option 2 in visual basic.
I know that you can go to tools, options and then choose on unhandled errors
only, but is there a VB command that I can use instead?

Cheers

Nicolaas
Nov 13 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Application.SetOption "Error Trapping", 2

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"windandwaves" <wi*********@coldmail.com> wrote in message
news:42********@clear.net.nz...
Hi Gurus

Does anyone know how I set the error trapping to option 2 in visual basic.
I know that you can go to tools, options and then choose on unhandled
errors only, but is there a VB command that I can use instead?

Cheers

Nicolaas

Nov 13 '05 #2

P: n/a
Douglas J. Steele wrote:
Application.SetOption "Error Trapping", 2

Doh, that was easy! I did not see it on the list of setoption items.
Great.
Nov 13 '05 #3

P: n/a
Here is a function that may be of use to some of you. It records all the
options set in your application in a table (tbln) with a field for the name
of the option and a field with the value. I have created two value fields,
one for development and one for users so that I can change all the settings
with a simple function (create a recordset of the table, run through the
recordset applying each option, etc...) I can change between development and
a user environment.

You can delete from the function any options that are not relevant to you.

Thanks for all your comments in my past posts.

Nicolaas
Public Function OptionRecorder(TblN As String, NameField As String,
ValueField As String)
Dim V As Variant
Dim D As String
Dim RST As Recordset
DoCmd.RunSQL ("DELETE FROM [" & TblN & "]")
Set RST = CurrentDb.OpenRecordset("SELECT * FROM [" & TblN & "];")
'-view

D = ("Show Status Bar")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Startup Dialog Box")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show New Object Shortcuts")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Hidden Objects")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show System Objects")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("ShowWindowsInTaskbar")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Macro Names Column")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Conditions Column")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Database Explorer Click Behavior")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-General Tab

D = ("Left Margin")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Right Margin")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Top Margin")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Bottom Margin")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Four-Digit Year Formatting")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Four-Digit Year Formatting All Databases")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Track Name AutoCorrect Info")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Perform Name AutoCorrect")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Log Name AutoCorrect Changes")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Enable MRU File List")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Size of MRU File List")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Provide Feedback with Sound")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Auto Compact")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("New Database Sort Order")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Remove Personal Information")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Database Directory")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-Edit/Find Tab

D = ("Default Find/Replace Behavior")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Confirm Record Changes")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Confirm Document Deletions")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Confirm Action Queries")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Values in Indexed")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Values in Non-Indexed")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Values in Remote")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Values in Snapshot")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Values in Server")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Values Limit")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-Datasheet Tab

D = ("Default Font Color")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Background Color")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Gridlines Color")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Gridlines Horizontal")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Gridlines Vertical")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Column Width")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Font Name")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Font Weight")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Font Size")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Font Underline")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Font Italic")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Cell Effect")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Animations")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Smart Tags on Datasheets")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
'-Keyboard Tab

D = ("Move After Enter")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Behavior Entering Field")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Arrow Key Behavior")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Cursor Stops at First/Last Field")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Ime Autocommit")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Datasheet Ime Control")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-Tables/Queries Tab

D = ("Default Text Field Size")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Number Field Size")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Field Type")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("AutoIndex on Import/Create")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Table Names")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Output All Fields")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Enable AutoJoin")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Run Permissions")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("ANSI Query Mode")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("ANSI Query Mode Default")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Query Design Font Name")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Query Design Font Size")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Property Update Options buttons")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-Forms/Reports Tab

D = ("Selection Behavior")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Form Template")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Report Template")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Always Use Event Procedures")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Show Smart Tags on Forms")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Themed Form Controls")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-Advanced Tab

D = ("Ignore DDE Requests")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Enable DDE Refresh")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default File Format")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Open Mode for Databases")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Command-Line Arguments")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("OLE/DDE Timeout (sec)")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Record Locking")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Refresh Interval (sec)")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Number of Update Retries")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("ODBC Refresh Interval (sec)")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Update Retry Interval (msec)")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Use Row Level Locking")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-Pages Tab

D = ("Section Indent")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Alternate Row Color")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Caption Section Style")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Footer Section Style")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Use Default Page Folder")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Page Folder")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Use Default Connection File")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Default Connection File")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-Spelling Tab

D = ("Spelling dictionary language")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling add words to")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling suggest from main dictionary only")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling ignore words in UPPERCASE")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling ignore words with number")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling ignore Internet and file addresses")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling use German post-reform rules")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling combine aux verb/adj")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling use auto-change list")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling process compound nouns")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling Hebrew modes")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Spelling Arabic modes")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-International Tab

D = ("Default direction")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("General alignment")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Cursor movement")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Use Hijri Calendar")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'-Error Checking Tab

D = ("Enable Error Checking")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Error Checking Indicator Color")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Unassociated Label and Control Error Checking")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("New Unassociated Label Error Checking ")

V = Application.GetOption(D)

rst.AddNew

rst.Fields(NameField) = D

rst.Fields(ValueField) = V

rst.update
D = ("Keyboard Shortcut Errors Error Checking")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update
D = ("Invalid Control Properties Error Checking ")

V = Application.GetOption(D)

rst.AddNew

rst.Fields(NameField) = D

rst.Fields(ValueField) = V

rst.update
D = ("Common Report Errors Error Checking")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update

'- VB
D = ("Error Trapping")

V = Application.GetOption(D)

RST.AddNew

RST.fields(NameField) = D

RST.fields(ValueField) = V

RST.update


Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.