IT tutorials
 
Office
 

Microsoft Access 2010 : Creating Your Own Databases and Tables - Working with Field Properties (part 4)

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Product Key Free : Microsoft Office 2019 – Serial Number
3/23/2014 1:36:01 AM

The Required Property: Making the User Enter a Value

The Required property is very important: It determines whether you require a user to enter a value in a field. This property is useful for foreign key fields, when you want to make sure the user enters data into the field. It’s also useful for any field containing information that’s needed for business reasons (company name, for example).

A foreign key field is a field that is looked up in another table. For example, in the case of a Customers table and an Orders table, both might contain a CustomerID field. In the Customers table, the CustomerID field is the primary key field. In the Orders table, the CustomerID field is the foreign key field because its value is looked up in the Customers table.


Set the Required Property from Design View

To designate a field as required (from Design view), follow these steps:

1.
Select the desired field.

2.
Click the Required text box in the Field Properties pane.

3.
Type Yes.

The Allow Zero Length Property: Accommodating for Situations with Nonexistent Data

You can use the Allow Zero Length property to allow a string of no characters. You enter a zero-length string by typing a pair of quotation marks with no space between them (””). You use the Allow Zero Length property to indicate that you know there is no value for a field.

Set the Allow Zero Length Property from Design View

To allow a zero-length field (from Design view), follow these steps:

1.
Select the desired field.

2.
Click the Allow Zero Length text box in the Field Properties pane.

3.
Select Yes from the drop-down list box.

The Input Mask Property: Determining What Data Goes into a Field

An input mask controls data the user enters into a field. For instance, a short date input mask appears as --/--/---- when the field is active. You can then simply type 07042005 to display or print 7/4/2005. Based on the input mask, you can ensure that the user enters only valid characters into the field.

Table 3 lists some of the placeholders that you can use in character strings for input masks in fields of the Text data type.

Table 3. Placeholders That Can Be Included in an Input Mask
PlaceholderDescription
0A number (0–9) is required.
9A number (0–9) is optional.
#A number (0–9), a space, or a plus or minus sign is optional; a space is used if no number is entered.
LA letter (A–Z) is required.
?A letter (A–Z) is not required; a space is used if no letter is entered.
AA letter (A–Z) or number (0–9) is required.
AA letter (A–Z) or number (0–9) is optional.
&Any character or space is required.
CAny character or space is optional.
>Any characters to the right are converted to uppercase.
<All the text characters to the right are changed to lowercase.

Set the Input Mask Property from Design View

To create an input mask (from Design view), follow these steps:

1.
Select the desired field.

2.
Click the Input Mask text box.

3.
Type the desired format, using the placeholders listed in Table 3.

Access includes an Input Mask Wizard that appears when you place the cursor in the Input Mask text box and click the build button to the right of the text box. The wizard, shown in Figure 2, provides common input mask formats from which to choose. To start the Input Mask Wizard, you click the button to the right of the Input Mask property.

Figure 2. Entering an input mask with the Input Mask Wizard.


The Input Mask Wizard is available only if you selected the Additional Wizards component during Access setup. If you did not select this component and then you try to open the Input Mask Wizard, Access prompts you to install the option on-the-fly the first time you use it.


For example, the input mask 000-00-0000;;_ (converted to 000\-00\-0000;;_ as soon as you tab away from the property) forces the entry of a valid social security number. Everything that precedes the first semicolon designates the actual mask. The zeros force the entry of the digits 0 through 9. The dashes are literals that appear within the control as the user enters data. The character you enter between the first and second semicolon determines whether literal characters (the dashes, in this case) are stored in the field. If you enter a 0 in this position, literal characters are stored in the field; if you enter 1 or leave this position blank, the literal characters aren’t stored. The final position (after the second semicolon) indicates what character is displayed to denote the space where the user types the next character (in this case, the underscore).

Here’s a more detailed example: In the mask \(999”) “000\-0000;;_, the first backslash causes the character that follows it (the open parenthesis) to be displayed as a literal. The three nines allow the user to enter optional numbers or spaces. Access displays the close parenthesis and space within the quotation marks as literals. The first three zeros require values 0 through 9. The dash that follows the next backslash is displayed as a literal. Four additional numbers are then required. The two semicolons have nothing between them, so the literal characters aren’t stored in the field. The second semicolon is followed by an underscore, so an underscore is displayed to indicate the space where the user types the next character. This sounds pretty complicated, but here’s how it works. The user types 8054857632. What appears is (805)485-7632. What is actually stored is 8054857632. Because the input mask contains three nines for the area code, the area code is not required. The remaining characters are all required numbers.

 
Others
 
- Microsoft Access 2010 : Creating Your Own Databases and Tables - Working with Field Properties (part 3)
- Microsoft Access 2010 : Creating Your Own Databases and Tables - Working with Field Properties (part 2)
- Microsoft Access 2010 : Creating Your Own Databases and Tables - Working with Field Properties (part 1)
- Microsoft Access 2010 : Creating Your Own Databases and Tables - Using Indexes to Improve Performance
- Microsoft Access 2010 : Creating Your Own Databases and Tables - Selecting the Appropriate Field Type for Data
- Microsoft Access 2010 : Creating Your Own Databases and Tables - Building a New Table (part 2) - Designing a Table from Scratch
- Microsoft Access 2010 : Creating Your Own Databases and Tables - Building a New Table (part 1) - Building a Table from a Datasheet
- Microsoft Access 2010 : Creating Your Own Databases and Tables - Types of Databases Available, Creating a New Database
- Taking Microsoft Project 2010 for a Test Drive (part 7) - How Long Will All These Tasks Take?
- Taking Microsoft Project 2010 for a Test Drive (part 6) - List the people on your project,Assign resources to tasks
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us