Poynor's Software Standards

The following document is an addendum to the MIS 333k Course Packet, by Byars and Poynor, published by Abels Copies. Because it is an addendum, your understanding of all Poynor's MIS 333k Software Standards requires the Course Packet as well as the following. Your homework assignments and semester project will be graded in terms of the combined standards.

Click on a numbered standard to expand the information. Click on the information to remove it.

  1. Option Explicit
  2. Option Explicit must be visible in the Declarations section of a standard module. Use modGlobals for this purpose; see "Modules" below. In new databases you can set this up automatically in VBE (Visual Basic Editor) with select Tools, Options, Editor and select Require Variable Declaration.
  3. Modules
  4. Have a standard module named modGlobals and place your shared Public variables and constants there. Create another standard module named modUtilities for general-purpose procedures. You will learn more about modules later in the semester.
    VBA Modules
  5. Compaction.
  6. All work you turn in should have automatic compaction enabled. In the Access database window, select Tools, Options, General and select Compact on Close. No work you turn in should be Zipped.
  7. References.
  8. Until you have the external library references set up correctly, you will be chasing phantom bugs in your programs. Inexperienced programmers sometimes do not recognize the importance of this step. When in VBE select Tools, References, and the those references in shown below. Other references may be included as necessary whenever we expand our need for VBA programming utilities and tool kits (web tools, for example). Also, when you move your programs onto different computers with different installations of Access 2002, you may need to reset references.
    VBE References
  10. Important procedures must have comments.
    Public Function Ordinal(varNum As Variant) As Variant
    ' Purpose: returns "1st", "2nd", "3rd" when sent 1,2,3,111,1.23, etc
    ' Args:  varNum (any number format)
    ' Rets:  variant string "14th" for example
    ' Author(s): Poynor
    ' Date(s): 6/2004
    ' Comments: numbers < zero are returned without "th", "nd", "rd" suffix
    ' Modification History:
  11. Button captions or pictures?
  12. If all buttons on your Access forms have pictures you are placing a puzzle in front of your users. They have to decide what each picture means before tentatively clicking the button. Pictures and icons can only convey certain (usually navigation) information very well. To make the users task a little more straightforward, it is usually best to place a word or two on the buttons instead of a picture. Can you choose informative pictures that would distinctly connote each operation for the line of buttons on the left? Probably not.
    form buttons
  13. Error traps.
  14. Important procedures must have error traps. We will learn about the error object and error trapping this semester.
  15. VBE Buttonbar.
  16. You will find it helpful to have additional buttons on the VBE buttonbar, so they have become standard. Right click the VBE buttonbar and select Customize, Commands. Use all the buttons you need. The following Edit buttons are the minimum standard. Outdent, Indent, Comment and Uncomment a block, and the four Bookmarks (make, go next, go previous, clear).
    VBE Button Bar
  17. Data entry errors.
  18. This is a standard objective of good programs, and you will be expected to meet the standard in all future professional work. Prevent erroneous data from entering your application. Design and write your programs so users cannot enter dates such as 2/30/03, and grade point averages of 5.0. Where possible provide defaults for all data entry values.
  19. Logic and data.
  20. This is another standard objective among professional programmers. You depart from the standard whenever you use data constants within program logic. Keep logic (programming) and data (tables) apart. Here is a simple example: SalesTax = SubTotalSale * .0825. The 8.25% tax belongs in a table instead buried in your logic. Tax rates do change frequently. It will be far easier to change the tax rate in one table than find all the places in your logic that use the constant!
  21. Name of key fields in tables.
  22. When naming fields in Access tables, use the prefix "pk" for primary keys and "fk" for foreign keys. Avoid names that are too general such as "ID". When you use a foreign key field be sure to keep the name the same as the primary key field and change the pk to fk. (Examples: pkPeopleID, fkPeopleID, pkCourseID, fkCourseID)

Understanding Software Standards for Poynor's sections of MIS 333k requires the Course Packet as well as the information on this page. Your homework assignments and semester project will be graded in terms of the combined standards.

Return to MIS 333k Syllabus