Representing Numbers and Dates

Numeric values and dates are most often presented in text boxes. As always, it's better to constrain the numeric values users can enter wherever possible. If the range of values is too broad, however, you might not be able to.

The Input Mask property in Access and the MaskedData control in Visual Basic provide a certain amount of control over numbers entered by means of a textbox—you can at least prohibit the entry of alphabetical characters. Access is also pretty smart about interpreting the data entered, but of course, this is after-the-fact data validation and not the best option if data limitation options are available.

Visual Basic 6 provides two new controls for entering calendar data, the MonthView control and the DateTimePicker control, shown in Figure 15-6. Access 2000 provides a calendar control similar to the MonthView control in Visual Basic.

click to view at full size.

Figure 15-6. The MonthView and DateTimePicker controls.

You can think of these controls as calendar equivalents of list boxes and combo boxes—the DateTimePicker displays the calendar only on demand, while the MonthView displays it at all times. Both controls handle only dates, however, not dates and times. This can lead to some odd complications when they're bound to Date/Time fields, so you need to be careful during implementation.

Visual Basic and Access also provide the Microsoft UpDown control (sometimes called a spinner control) that can be used for entering both numeric and Date/Time data. Most users will be familiar with UpDown controls from having set the date and time in Windows, as shown in Figure 15-7.

UpDown controls are particularly useful if values are not incremented evenly—a date that can only be on a weekday, for example, or a numeric value that must be rounded to the nearest hundred.

Figure 15-7. Windows uses UpDown controls for controlling time values.

A final set of Visual Basic controls that can be used for entering numeric data are slider controls and scroll bars, shown in Figure 15-8.

Figure 15-8. Slider controls and scroll bars have limited value in database applications.

These controls have a fairly limited value in database applications. They're essentially only graphic mechanisms for setting numeric values, and as such could theoretically be used to enter any numeric data. (You probably don't think of scroll bars as numeric tools—that's not their manifest model—but they actually return numeric values to the application in the background.)

I find them most useful when users can compare a set of values whose relative position is more important than their precise values—that is, "This field value is more important than that field value." For example, I have occasionally used sliders for match checking, allowing users to set the relative importance or required tolerance of the fields to be compared in finding a match for a particular record.



Designing Relational Database Systems
Designing Relational Database Systems (Dv-Mps Designing)
ISBN: 073560634X
EAN: 2147483647
Year: 1999
Pages: 124

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