Overriding the Field Properties of Tables

Access uses the table's property values assigned to the fields as defaults. The form or subform inherits these properties from the table or query on which the form is based. You can override the inherited properties, except for the Validation Rule property, by assigning a different set of values in the Properties window for the control. Properties of controls bound to fields of tables or queries that are inherited from the table's field properties are shown in the following list:

  • Format

  • Decimal Places

  • Status Bar Text

  • Typeface characteristics (such as Font Name, Font Size, Font Bold, Font Italic, and Font Underline)

  • Validation Rule

  • Validation Text

  • Default Value

Values of field properties that you override with properties in a form apply only when the data is displayed and edited with the form. You can establish validation rules for controls bound to fields that differ from properties of the field established by the table, but you can only narrow the rule. The table-level validation rule for the content of the HRType field, for example, limits entries to the letters H, Q, Y, S, R, B, C, and T. The validation rule you establish in a form can't broaden the allowable entries; if you add F as a valid choice by editing the validation rule for the HRType field to InStr("HQYSRBCTF",[HRType])>0, you receive an error when you type F.

However, you can narrow the range of allowable entries by substituting InStr("SQYB",[HRType])>0. Notice that you can use expressions that refer to the field name in validation-rule expressions in forms; such expressions aren't permitted in field-level validation-rule expressions in Access 2003.



Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net