Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 2. Creating Access Tables > Understanding tblCustomers Field Properties

2.7. Understanding tblCustomers Field Properties

After you enter the field names, data types, and field descriptions, you may want to go back and further refine each field. Every field has properties, and these are different for each data type. In tblCustomers, you must enter properties for several data types. Figure 2.22 shows the property area for the field named CreditLimit. Notice that there are two tabs on the property box — General and Lookup.

Figure 2.22 shows 11 properties available for the CreditLimit Currency field. Other types, such as Number and Date/Time, Text, or Yes/No show more or fewer options.


Figure 2.22. The property area for the Currency field named CreditLimit


Pressing F6 switches between the field entry pane and the property pane (you may have to press F6 several times before you reach the desired pane). You can also move between panes by clicking the desired pane. Some properties display a list of possible values, along with a downward-pointing arrow when you move the pointer into the field. When you click the arrow, the values appear in a drop-down list.

The Field Properties pane of the Table Design window has a second tab: the Lookup tab. After clicking this tab, you may see a single property, the Display Control property. This property is used for Text, Number, and Yes/No fields.

Figure 2.23 shows the Lookup Property window for the Active Yes/No field where Display Control is the only property. This property has three choices: Check Box, Text Box, and Combo Box. Choosing one of these determines which control type is used when a particular field is added to a form. Generally, all controls are created as text boxes except Yes/No fields, which are created as check boxes by default. For Yes/No data types, however, you may want to use the Text Box setting to display Yes/No, True/False, or another choice that you specifically put in the format property box.

NOTE

You learn about combo boxes in Chapter 7 and again in Chapter 19.

If you're working with Text fields instead of a Yes/No field and know a certain Text field can only be one of a few combinations, select the combo box choice for the display control. Figure 2.24 shows the Lookup tab when combo box has been selected as the display control for the Credit Status field. There are only two acceptable values for Credit Status: OK and Not OK. These two values (separated by a semicolon) are specified as the combo box's Row Source, and the Row Source Type is set to Value List.

Figure 2.23. The Lookup tab for a Yes/No field


Figure 2.24. Setting up a combo box as the display control for Credit Status


Although Figure 2.24 shows a combo box using a value list for its items, you could also specify a query or SQL statement as the combo box's row source.

Figure 2.25 shows how the Credit Status field appears when tblCustomers is displayed as a datasheet. The user can select only OK or Not OK as the credit status, and the same combo box appears when the field is added to an Access form.

The properties for a Lookup field are different for each data type. The Yes/No data type fields differ from Text fields or Number fields. Because a Lookup field is really a combo box, the standard properties for a combo box are displayed when you select a Lookup field data type.

Figure 2.25. Using a combo box as a lookup control to restrict user input on a field


  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint