ponedeljek, 4. januar 2010

Expert advice for form design

Dear reader,
In today’s post I would like to share with you some of the facts about form design that are working very well and which I’m using consistently in all applications I develop. Maybe you can get some use from my approach to form design.

As we all know, analysis and preparation of user needs are essential in building all elements of an application. Such approach can result in forms, which can be truly accepted by users. Such forms are uniform throughout the whole application, they are ergonomic and spacious enough to allow further development.

Here are some design needs which must be satisfied on every Access form:

  1. The name of a form must be visible.
  2. The name of a form must be an expression of its functionality.
  3. User must visually see all mandatory fields.
  4. All mandatory fields need to be presented and visible on the first page of a form.
  5. All fields with a default value, auto number functionality or read only property are to be designed with a different background color.

It is common to put the name of a form into the window’s title with the Forms!FormName.Caption property. I rather use Form Header Section with the label called lblFormName. This label can be larger and is therefore much more visible.


Picture 1: Title of the presented form is larger and more visible than the window’s title.

In my applications all mandatory fields have bold labels with the additional foreground color, named mandatoryLabelColor. All mandatory fields are surrounded with the border color, called mandatoryBorderColor.


Picture 2: Mandatory fields are visible on the first view.

All mandatory fields are positioned on the first page. All other non mandatory fields are positioned after first page break. With such design the user immediately knows that he/she must insert/update only the fields, visible at first sight. All other fields are below them on second page which is immediately visible with moving of the Scroll bar, which is presented on right side of the form.
I truly advice designing a form with page breaks and having the Scroll bar for easy moving between pages. From my experience this approach works better on forms with many fields than the approach using Tabs.

All fields with default values, fields with the auto number functionality or read only fields have a different background color. For example: I use yellow background color, called specialBackGroundColor. Additionally, all those fields have AutoTab property set to No.

The described approach does not require any programming and as such it is easier to manage the application in time and with new versions of Access software.

sreda, 30. december 2009

Microsoft Access: use a validation rule instead of the Required property

When you want to require users to enter a value in a field, a common technique is to set the Required property for the field to Yes (for example tabPerson.Name.Required = Yes). However, when the user is then adding records to the table and neglects to insert value in that field, the build-in error message that appears is not very helpful:

"The field TableName.FieldName cannot contain Null value because the Required property is set to True. Enter a value in this field."

This error message is not appropriate for typical user, whether it is in English or any other language.

Insetead, I use another simple approach when building table properties:
  1. Set Table.Field.Required to No.
  2. Set Table.Field.Validation Rule to Is Not Null.
  3. Set Table.Field.Validation Text to The value in the field is required. Enter a value or select it from the list.
In this way, you can provide more specific information and helpful hints about how to enter the correct data, rather then just a "required" message.

Note. When converting an Access table into SQL Server we must consider this design property (Required) and set this table or field property manuall.