Skip to Main Content
Access 2002 Programming by Example
book

Access 2002 Programming by Example

by Bob Villareal
January 2002
Beginner content levelBeginner
576 pages
13h 23m
English
Que
Content preview from Access 2002 Programming by Example

Determining which Errors Occur

The question naturally arises, “How do you know what error has occurred?” Even though Access provides error codes and messages, they are often difficult for users to interpret. If that isn’t enough, they usually don’t have a clue as to what to do about the error. Error handling makes your application more user friendly while giving you more control over what the user encounters.

Suppose you have a table with error codes and their corresponding messages. The following DAO program generates just such a table:

 Sub GenerateErrorTable() Dim db As DAO.Database, rs As DAO.Recordset Dim i As Integer, Msg$ Set db = CurrentDb() Set rs = db.OpenRecordset("ErrorCodes") For i = 1 To 32766 Msg$ = Error$(i) If Msg$ <> "Application-defined ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Access 2003 Programming by Example with VBA, XML, and ASP

Access 2003 Programming by Example with VBA, XML, and ASP

Julitta Korol
Microsoft® Access® 2010 Programmer's Reference

Microsoft® Access® 2010 Programmer's Reference

Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Jerry Dennison

Publisher Resources

ISBN: 0789725940Purchase book