common access database form errors, access DB error

list of common MS access Db forms errors.
Microsoft Access Form Tips and Avoiding Common Mistakes
reference:http://www.fmsinc.com/tpapers/genaccess/formtips.html


Access forms are extremely powerful. However, the developer can easily make mistakes to cause a form to behave incorrectly or poorly. Here’s a simple checklist of common problems with form designs. Developers should verify these problems do not exist prior to finalizing their forms.

Common Mistakes
Check these items on your forms before you distribute them:

Verify Data Sources

Verify that the tables and queries used by the form are valid. This includes checking the form’s record source and the row source of all combo boxes and list boxes.

Use Captions

Without setting the form caption property, the name of the form appears which may not be what you want your users to see.

Spell Check

Make sure that what the user sees is accurate and spelled correctly. In addition to the labels, the user also sees validation text and control tip text. A common mistake occurs when a control with these properties is copied, and only the label and control source are changed. In this case, other properties such as validation rule, input mask, default value, format, etc. may also be wrong.

Avoid Duplicate Hotkeys

Make sure accelerator keys (hotkeys) are not duplicated. Accelerator keys allow users to use the Alt key and letter to jump to a control. They are set by using the “&” character in captions followed by the letter. For instance, a Help button may have an “H” hotkey and appear as “Help” with its caption “&Help”. A common mistake is to assign the same key to multiple controls on the form. Test your form by using each hotkey twice and verify it doesn’t go to more than one control.
Command Buttons Must have an OnClick Event
If it doesn’t have an OnClick event, the button should be removed, made invisible, or fixed. Sometimes the OnClick event is accidentally assigned to the wrong event, such as the OnDblClick event. Alternatively, an OnClick event is not necessary if it has a Hyperlink.

Verify Tab Order

Make sure the tab order of the controls is correct. By default, the tab order should go left to right, top to bottom. This is what users expect. If your form does not behave this way, it exhibits unexpected (unintuitive) behavior which can be frustrating for your users. The default tab order can be easily set under the View, Tab Order menu. For situations where you want the tab order to behave differently (for instance, you may want it to go down columns for an option group), you can change this, but at least you’re making a deliberate decision to deviate from the default order.

Explicitly Set the Allowed Views

Views Allowed should be explicitly assigned to only display the way you want your users to see the form. Options include viewing the form in form view, datasheet view, and in Access 2002, PivotChart and PivotTable views. Without the undesirable options turned off, a user can change the view of the form by right clicking on the form and switching with the shortcut menu.


Verify Shortcut Menu Setting

By default, the Shortcut menu property is set to Yes, and no shortcut menu is specified. This means Access’ default menu appears. If this is not desired, set this property to No.
Verify Help File Context IDs
If you are using a help file, make sure the help file name and help context ID are correct.


Avoid Missing Code

Make sure every event that has [Event Procedure] assigned actually has an event procedure defined. A common mistake is to assign the event without actually clicking through to write the code for it. This can also happen if you rename a control and forget to rename the event procedures tied to the old name.


Set AutoCenter to Yes

Make sure the AutoCenter property is set to Yes. AutoCenter ensures that when your form is opened, it opens in the center of the screen regardless of where you placed it when you saved it on your machine, or what the user’s screen resolution is.


Set Resize Property to Yes

Make sure the AutoResize property is set to Yes. AutoResize automatically adjusts the display of your form to the size you designed it. If this property is set to No, the form appears in the way you last saved it, which can easily be too big or small.


Set Combo Boxes LimitToList to Yes

Combo boxes should have their LimitToList property set to Yes so users can only enter values in the list. If this is set to No, users can enter any value. To support users adding new values to the list, set the LimitToList property to Yes, and use the NotInList event to handle the new values.
Increase Number of Rows Displayed for Combo Boxes
The drop down from a combo box should be greater than the default of 8 (16 for Access 2007), so that if your list is longer, more can be shown without the user being forced to scroll through them. We recommend 25 or more.


Set Combo Box AutoExpand Property to Yes

AutoExpand simplifies data entry by auto-filling the remainder of the selection based on the first few letters the user types.
Set AllowDesignChanges Property to Design View Only
The AllowDesignChanges property should not be All Views, but rather Design View Only. When set to All Views, users can change the design even though they are not in design view. This is something one rarely wants them to do. In fact, if the form property sheet is open the last time a form was designed, when a form appears with this property set to All Views, the property sheet also appears which is very confusing to end-users.


Use System Colors

For the BackColor property of form sections and controls, use the system gray color (-2147483633) rather than the default gray (12632256). In recent versions of Windows (Windows Me, 2000, XP), there's a slight change in the way gray is displayed, and the older gray appears darker than it should. Mixing these two values for older Windows versions is not a problem but you can see a difference on new versions. For Access 2007, see the tips below.