SlideShare a Scribd company logo
CHAPTER 4
Working with
Fields
Each table consists of one or more fields. In this chapter, you learn
about field properties and how to set properties such as the field size,
caption, format, and default value. You also learn how to create input
masks and validation rules to help reduce data-entry errors.
Understanding Field Properties .  .  .  .  .  .  .  .  .  .  .  .  .  .  64
Understanding Field Sizes  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  65
Change a Field Size .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 66
Set a Field Caption  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 67
Set a Field’s Format  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  68
Set a Default Value .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 70
Make a Field Required .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  71
Index a Field .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 72
Align Data within a Field  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 73
Create an Input Mask .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  . 74
Create a Validation Rule .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  76
Create a Record-Level Validation Rule .  .  .  .  .  .  .  .  .  .  . 78
64
When you create a table, you define each field with data such as the field name, data type, and
an optional description. These are examples of the field’s properties, which are a collection
of data that defines the field and controls how it works. Each field has several other properties,
including its size, the caption that appears as the field’s datasheet heading, and the format that
the field uses to display its data. Other properties define rules for making entries, such as specifying
whether an entry is required or restricting an entry to certain values.
Understanding Field Properties
A	Properties pane
When a field is selected
in the Design view, its
properties appear in the
lower pane.
B	General tab
The General tab contains
most of the properties
that you will work with.
C	Lookup tab
The Lookup tab is
primarily for setting up
lookup lists.
D	Drop-down lists
Some properties have
drop-down lists from
which you can make a selection;
click to open the list. Other
fields have builder buttons ( ),
which open a dialog box that
guides you through the process
of building an entry.
E	Property information
When the insertion point is in a
property’s box, information about
that property appears here.
F	Yes/No properties
Some properties represent yes/no
questions; these are typically
already filled in with default
values.
65
CHAPTER
4
Each field has a size that limits the amount of data you can store in it. There are different ways of
expressing the field size depending on the type of field.
The following table lists the specifications for the data types for which Field Size is a configurable
setting. Many field types do not allow you to set a field size. For a numeric field, the advantage of
choosing a field size that takes up fewer bytes is that it results in a smaller database file. The file
size difference becomes more apparent the more records the table contains.
Understanding Field Sizes
Field Type Default Size Notes
Text 255 characters You can specify any number of characters from 0 to 255. Each
character occupies 1 byte of disk space.
Number Long Integer The choice of number format determines the number of bytes used
to store it:
Byte: Integers from 0 to 255 (1 byte).
Integer: Integers from -32,767 to +32,767 (2 bytes).
Long Integer: Integers from -2,147,483,648 to +2,147,483,647
(4 bytes).
Single: Integers from -3.4 x 1038
to +3.4 x 1038
and up to
7 significant digits (4 bytes).
Double: Floating-point numbers from -1.797 x 10308
to
+1.797 x 10308
and up to 15 significant digits (8 bytes).
Replication ID: A globally unique identifier (GUID), such as a
randomly generated ID number (16 bytes).
Decimal: Integers with a defined decimal precision with values
between -1028
and +1028
. The default precision is zero, and the
default number of decimal places displayed is 18.
AutoNumber Long Integer The same as Number, except there are only two choices: Long
Integer or Replication ID.
66
For the Text Data Type
1	In the Design view, click in the
field that you want to change.
	 The properties for that field
appear.
2	Click in the Field Size row on
the General tab.
3	Type a new field size.
Note: The field size for a text field
is expressed as a number of
characters.
	 Access changes the field size.
For the Number Data Type
1	In the Design view, click in the
field that you want to change.
	 The properties for that field
appear.
2	Click in the Field Size row.
3	Click the Field Size and
then click the field size that
you want.
Note: For a numeric field, size is
expressed as a number type. See the
section “Understanding Field
Properties” for details.
	 Access changes the field size.
Change a Field Size
If you are working with a field that offers a configurable field size, it is best to set the field’s size
to as small a value as possible, while still being large enough to accommodate all possible entries.
This is the most efficient course because it keeps the database file size to a minimum.
If your table will contain just a few entries, its field sizes will not make that much difference.
However, the difference in file size becomes more pronounced as more records are stored in the table.
Change a Field Size
67
CHAPTER
4
A	When you display the table’s
datasheet, the field’s caption
appears as its column
heading.
Note: To check the caption in a
datasheet, click the Save button
( ) to save it and then switch
to the Datasheet view.
1	In the Design view, click in
the field for which you want
to set a caption.
	 The properties for that field
appear.
2	Click here and type a
caption.
Note: The caption can include
spaces and symbols and can have
up to 255 characters.
Set a Field Caption
Afield’s caption is the text that appears as the field’s heading in the Datasheet view, and
the default caption is the field name. For example, if you name a field OrderDate, the text
“OrderDate” appears as the field’s datasheet heading. You can specify captions for fields that are
different from their actual names.
For example, if you have a field called LastName, you can set up its caption to appear as “Last Name”
with a space between the words, which is easier to read. Captions appear not only in datasheet
headings, but also on labels in forms and reports.
Set a Field Caption
68
B	For Date/Time data types,
the choices appear as date/
time formats.
1	In the Design view, click in the
field that you want to change.
	 The properties for that field
appear.
2	Click the Format and then
click the format that you want
to apply to the field.
A	For a Number or AutoNumber
field, the choices represent
different number types, such
as General, Currency, and
Percent.
Set a Field’s Format
Afield’s format determines how Access displays the field’s data. In a field that contains dates, for
example, you could display the dates using the format 12/25/2013, 25-Dec-13, or Wednesday,
December 25, 2013. You can change a field’s format to update its appearance in datasheets, forms,
and reports.
The field format is most significant for fields that store data numerically, such as Number, Currency,
and Yes/No. For example, if you have a field that contains sales tax values, you might prefer to
display those numbers as percentages, such as 5%, rather than decimal values, such as 0.05.
Set a Field’s Format
69
CHAPTER
4Working with Fields
TIP
Why is the Format list blank for some fields?
Many of the Access data types have no preset formats, so the Format list for those fields is blank. Data
types that show a blank Format list are Short Text, Long Text, and Hyperlink. Other data types have no data
format at all, so those fields do not even display the Format list. Data types that do not display the Format
list are OLE Object and Attachment.
D	For a Calculated field, all the
choices from all the other field
types are available because
Access cannot automatically
determine what type of data it
will hold.
C	For Yes/No fields, the choices
appear as ways of expressing
yes or no.
70
A	When you display the table’s
datasheet, the default value
appears in new records.
Note: The default value does not
automatically populate existing
records.
1	In the Design view, click in
the field for which you want
to set a default value.
	 The properties for that field
appear.
2	Click here and type a default
value.
Note: When you move away
from the text box, Access
automatically adds quotation
marks around what you typed
if the field type is Text.
Set a Default Value
You can speed up data entry for fields that usually contain the same value by making that value
the default. For example, suppose that you have a table that includes a PaymentType field, which
can take values such as Cash, Check, and Credit Card. If most of your clients pay by credit card, you
can make Credit Card the default value in the PaymentType field.
When you have specified a default value for a field, each time you start a new record, Access
automatically fills in the field with that value.
Set a Default Value
71
CHAPTER
4
	 When you enter a new record
in the table, a warning
appears if you do not enter
a value in that field.
A	Click OK to clear the error
and then type a value in the
required field.
1	In the Design view, click in
the field that you want to
make required.
	 The properties for that field
appear.
2	Click the Required and
then click Yes.
Make a Field Required
In many tables, one or more fields must be filled in for each record. For example, in a Customers
table, the CompanyName field should be filled in for each record. To ensure that a particular field
is always filled in with data, you can configure the table to make the field required. When a field is
required, Access does not enable users to skip it during data entry.
The primary key field is always required for each record in a database, but you can also make other
fields required without changing the primary key setting.
Make a Field Required
72
1	In the Design view, click in the
field that you want to index.
	 The properties for that field
appear.
2	Click the Indexed and then
click Yes (Duplicates OK).
	 This sets the field to be indexed
without forcing entries in it to
be unique.
A	You can choose Yes (No
Duplicates) if you prefer that
records have unique entries for
that field.
	 If you chose Yes (No Duplicates)
and you then try to enter an
identical value for two records, an
error message appears.
B	Click OK to clear the message
and then correct the error.
Index a Field
When you perform searches on a database that contains many records, a delay can occur as
Access searches. To minimize searching delays, you can set a field to be automatically indexed,
which means that Access gathers extra data about the field that enables it to locate data in the field
extremely fast. Searches based on that field will take place more quickly.
The two types of indexing are Yes (Duplicates OK) and Yes (No Duplicates). The latter has the side
effect of forcing each record to have a unique value for that field, as with the primary key field.
Index a Field
73
CHAPTER
4
A	The next time that you
display the datasheet,
Access applies the selected
alignment to the field.
1	In the Design view, click in
the field whose data you
want to align.
	 The properties for that field
appear.
2	Click the Text Align and
then click the alignment that
you want.
Align Data within a Field
You can make your tables easier to read by aligning text and numbers within a field. By default,
Access uses the General alignment, which means that it aligns numbers with the right side of
the field and text with the left side of the field. For any field, you can choose the Left or Right
alignment, or you can choose Center, which aligns data with the center of the field.
Excel also offers a Distribute alignment, which adds space between each character so that the field
data is aligned with both the left and right side of the field.
Align Data within a Field
74
	 The Input Mask Wizard opens.
4	Click the type of input mask
that you want.
A	To try the mask, you can click
in the Try It box and then type
a sample entry.
5	Click Next to customize the
mask.
B	If you do not want to
customize the mask, click
Finish.
1	Click in the field for which you
want to create an input mask.
	 The properties for that field
appear.
2	Click in the Input Mask row.
3	Click the Build icon ( ).
Create an Input Mask
Amajor database problem is data entered inconsistently, such as phone numbers entered as
(123)555-6783 and 123-555-6783. You can help prevent such inconsistencies by applying an
input mask to the field. An input mask is a kind of template that shows users how to enter the data
and prevents them from entering incorrect characters, such as a letter where a number is required.
For example, here is an input mask for a phone number: (___)___-____. Each underscore (_) acts as
a placeholder for (in this case) a digit, and the parentheses and dash appear automatically as the
user enters the number.
Create an Input Mask
75
CHAPTER
4Working with Fields
TIP
What do the input mask characters mean?
Input masks use characters to represent the types of data that they will accept. The following table shows
the most commonly used characters. For more characters, look up “Input Mask Character Reference” in
Access Help.
Character Use Character Use
0 Single digit, required A Single letter or number, required
9 Single digit, optional a Single letter or number, optional
# A digit, space, plus sign, or
minus sign
& Any character or a space, required
L Single letter, required C Any character or a space, optional
? Single letter, optional
9	Click how you want the data to be stored
( changes to ):
	 With the symbols in the mask: The extra
symbols (such as the parentheses and dash
in a phone number mask) are stored along
with the data.
	 Without the symbols in the mask: The
extra symbols are not stored with the data.
0	Click Finish.
	 The input mask code appears in the Input
Mask row in the field’s properties.
6	Modify the input mask’s code if you
want to.
7	Click the Placeholder character to
select a different placeholder character
if necessary.
C	To try the mask, you can click in the Try
It box and then type a sample entry.
8	Click Next.
76
	 The Expression Builder dialog
box opens.
4	Enter the expression that
represents the criteria you
want to specify.
5	Click OK.
Note: You could have simply
typed the validation rule into the
row and skipped steps 3 to 5, but
the Expression Builder’s tools can
be useful for complex expressions.
Create the Rule
1	In the Design view, click in
the field for which you want
to create a validation rule.
	 The properties for that field
appear.
2	Click in the Validation
Rule row.
3	Click .
Create a Validation Rule
Although an input mask helps a user enter data into a field using the proper number and type
of characters, it cannot restrict the field to certain entries based on logic. A better solution
for preventing data-entry errors is the data validation feature. With data validation, you create
validation rules that specify exactly what kind of data can be entered in a field and in what range
that data can fall. You can also specify an error message that appears when a user enters data that
does not satisfy a validation rule.
Create a Validation Rule
77
CHAPTER
4Working with Fields
TIP
How do I use the Expression Builder?
The Expression Builder can guide you in determining the correct
syntax for an expression. There are many types of expression
content available, including functions, constants, and operators.
For example, to enter the expression from the steps in this section
(>0) ,you would do the following:
1	Click Operators.
2	Click Comparison.
3	Double-click >.
A	The > character appears in the expression at the top of the
dialog box.
4	Type 0.
5	Click OK.
Test the Rule
B	When the rule is violated,
a custom error message
appears, containing the text
that you specified in the
Validation Text row.
1	Click OK and then retype the
field entry.
A	The validation rule appears
in the Validation Rule row.
6	Type the text for the error
message in the Validation
Text row.
78
1	In the Design view, click the
Design tab.
2	Click Property Sheet.
	 The Property Sheet for the
entire table appears.
3	Click in the Validation Rule
box and type the expression.
4	Click here and type the error
message text.
5	Click Test Validation Rules.
	 If the table contains data
already, a warning appears that
the data must be checked.
6	Click Yes.
Create a Record-Level Validation Rule
Although most validation rules involve a single field in the table, you can create rules that involve
two or more fields. For example, a rule might compare the value of one field with another. This is
called a record-level validation rule because it involves multiple fields in each record.
For example, in an Orders table, you could set up a record-level validation rule that checks to make
sure that the Order date is before (or the same as) the Shipped date because an order cannot be
shipped before it is placed.
Create a Record-Level Validation Rule
79
CHAPTER
4Working with Fields
TIPS
How do I construct a validation rule that contains field names?
You can either use the Expression Builder or type field names
directly into the expression. To use the Expression Builder, click in
the Validation Rule box and click to open the Expression
Builder. Click the table name in the Expression Elements list.
Double-click each field to which you want to add to the expression
in the Expression Categories list. Click OK. To enter field names
directly into the Validation Rule box, enclose each one in square
brackets: [OrderDate].
What happens to existing data
that violates the validation rule?
Nothing happens to it; it is allowed
to continue to exist. However, new
records will not be permitted to
violate the rule, and if you ever edit
the record that violates the rule, you
will not be able to save changes to
it until you fix the violation.
	 If existing data violates the new
rule, another warning appears.
You can either keep the new rule
or change it if this happens.
8	Click Yes to keep the new rule,
even if some existing data
violates it.
A	You can also click No to go back
to the previous rule (if any).
	 A confirmation dialog box opens.
9	Click OK.
	 The check is complete.
	 If the table has not been saved,
a prompt appears to save it.
7	Click Yes.

More Related Content

PPT
Access07 l1 ch1
PPTX
Working with Star Office Base - R.D.Sivakumar
DOC
Microsoft access exercises
PDF
MS Access 2010 tutorial 5
PDF
Basic Access Notes
PPTX
Integration with Office Automation Applications - R.D.Sivakumar
PDF
Access07 l1 ch1
Working with Star Office Base - R.D.Sivakumar
Microsoft access exercises
MS Access 2010 tutorial 5
Basic Access Notes
Integration with Office Automation Applications - R.D.Sivakumar

What's hot (20)

PDF
MS Access 2010 tutorial 3
PPTX
Datatypes, Field Properties, Validation and Masking
PPT
Ms Access ppt
PDF
Access 2007 lecture notes students
PPTX
Lesson Six Entering And Editing Data In Tables
PPT
Excel 2007 Unit C
PDF
Ms access notes
PDF
Using List Views
PPTX
Access lesson 01 Microsoft Access Basics
PPT
PPTX
Access lesson 02 Creating a Database
PDF
Exp31sp1 at a-glance-en
PPTX
Access lesson 03 Creating Queries
PPT
Access 2007
PPTX
Access lesson 04 Creating and Modifying Forms
PPTX
Excel chapter-4
PPTX
Access lesson05
PDF
Basic introduction to ms access
PPT
Microsoft Office Excel 2003 Sorting And Filtering
PPTX
PPT On MS-Access 2007 | Full Concepts |
MS Access 2010 tutorial 3
Datatypes, Field Properties, Validation and Masking
Ms Access ppt
Access 2007 lecture notes students
Lesson Six Entering And Editing Data In Tables
Excel 2007 Unit C
Ms access notes
Using List Views
Access lesson 01 Microsoft Access Basics
Access lesson 02 Creating a Database
Exp31sp1 at a-glance-en
Access lesson 03 Creating Queries
Access 2007
Access lesson 04 Creating and Modifying Forms
Excel chapter-4
Access lesson05
Basic introduction to ms access
Microsoft Office Excel 2003 Sorting And Filtering
PPT On MS-Access 2007 | Full Concepts |
Ad

Similar to Micro Soft Access - Working with Fields (20)

PDF
Computer Science Database Chap06 (ICS12).pdf
PPTX
OPERATE DATABASE APPLICATION
PPTX
Access lesson 02 Creating a Database
PPTX
EDITING FIELDS AND THEIR PROPERTIES.pptx
PPTX
tables and datatypes2.pptx
PDF
Create a table access - office
PPTX
Defining Table Relationships
PPTX
oprate database Application program hardware
PPTX
ECDL module 5: using databases [To be continued]
PPT
Data Types And Field Properties
PDF
DATABASES NOTES FOR STUDENTS TAKING MICROSOFT PACKAGES
PPTX
Presentation on Database Using MS Access
PPTX
Priyank Goel PPT.pptx
PPT
Access 2007-Datasheets 1-Create a table by entering data
PPT
Data Types and Field Properties.ppt
DOCX
PPT
New slides access
PPTX
Lecture2 slides
PDF
Ms access
DOC
Acccesss notes
Computer Science Database Chap06 (ICS12).pdf
OPERATE DATABASE APPLICATION
Access lesson 02 Creating a Database
EDITING FIELDS AND THEIR PROPERTIES.pptx
tables and datatypes2.pptx
Create a table access - office
Defining Table Relationships
oprate database Application program hardware
ECDL module 5: using databases [To be continued]
Data Types And Field Properties
DATABASES NOTES FOR STUDENTS TAKING MICROSOFT PACKAGES
Presentation on Database Using MS Access
Priyank Goel PPT.pptx
Access 2007-Datasheets 1-Create a table by entering data
Data Types and Field Properties.ppt
New slides access
Lecture2 slides
Ms access
Acccesss notes
Ad

More from FaHaD .H. NooR (20)

PDF
FAHAD HASSAN NOOR || UCP Business School Data Analytics Head Recommended | MB...
PDF
FAHAD HASSAN NOOR || UCP Business School Program Manager Recommended | MBA | ...
PDF
FAHAD HASSAN NOOR || UCP Business School Associate Dean Recommended
PDF
FAHAD HASSAN NOOR || UCP Business School
PDF
Drop Shipping in the Q-Commerce Era, A case study of Daraz. pk | Project by F...
PDF
Operations Management A-Z: Business Processes and Systems | Fahad Hassan Noor
PDF
Supply Chain Management A-Z: Operations & Logistics Basics | Fahad Hassan Noor
PDF
Inventory Management A-Z: Supply Chain & Business Operations | Fahad Hassan N...
PDF
Supply Chain Management A-Z: Operations & Logistics Certified - Udemy - Fahad...
PDF
Facebook Ads & Facebook Marketing MASTERY | Coursenvy ® - Fahad Hassan Noor -...
PDF
Training for Zendesk Administrators MasterClass - Fahad Hassan Noor
PDF
TikTok Marketing: Grow Your Account & Master TikTok Ads - Fahad Hassan Noor
PDF
Amazon FBA Private Label Course for Beginners | Amazon 2022 - Fahad Hassan Noor
PDF
Complete Video Production, Video Marketing, & YouTube Course - Fahad Hassan Noor
PDF
Fahad Hassan Noor | Zendesk Customer Support Portal Certified | Udemy Premium...
PDF
Fahad Hassan Noor | Zendesk Customer Support Portal Certified | Udemy Premium...
PPTX
Supply Chain Management
PPTX
Creating and Managing Supplier Relationships
PPTX
ETHICAL AND SUSTAINABLE SOURCING
PPTX
Purchasing mangement - Puchasing Process - Make Or Buy Decisions - Supplier S...
FAHAD HASSAN NOOR || UCP Business School Data Analytics Head Recommended | MB...
FAHAD HASSAN NOOR || UCP Business School Program Manager Recommended | MBA | ...
FAHAD HASSAN NOOR || UCP Business School Associate Dean Recommended
FAHAD HASSAN NOOR || UCP Business School
Drop Shipping in the Q-Commerce Era, A case study of Daraz. pk | Project by F...
Operations Management A-Z: Business Processes and Systems | Fahad Hassan Noor
Supply Chain Management A-Z: Operations & Logistics Basics | Fahad Hassan Noor
Inventory Management A-Z: Supply Chain & Business Operations | Fahad Hassan N...
Supply Chain Management A-Z: Operations & Logistics Certified - Udemy - Fahad...
Facebook Ads & Facebook Marketing MASTERY | Coursenvy ® - Fahad Hassan Noor -...
Training for Zendesk Administrators MasterClass - Fahad Hassan Noor
TikTok Marketing: Grow Your Account & Master TikTok Ads - Fahad Hassan Noor
Amazon FBA Private Label Course for Beginners | Amazon 2022 - Fahad Hassan Noor
Complete Video Production, Video Marketing, & YouTube Course - Fahad Hassan Noor
Fahad Hassan Noor | Zendesk Customer Support Portal Certified | Udemy Premium...
Fahad Hassan Noor | Zendesk Customer Support Portal Certified | Udemy Premium...
Supply Chain Management
Creating and Managing Supplier Relationships
ETHICAL AND SUSTAINABLE SOURCING
Purchasing mangement - Puchasing Process - Make Or Buy Decisions - Supplier S...

Recently uploaded (20)

PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Autodesk AutoCAD Crack Free Download 2025
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
AutoCAD Professional Crack 2025 With License Key
PPTX
history of c programming in notes for students .pptx
PPTX
Advanced SystemCare Ultimate Crack + Portable (2025)
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Download FL Studio Crack Latest version 2025 ?
PDF
Complete Guide to Website Development in Malaysia for SMEs
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Monitoring Stack: Grafana, Loki & Promtail
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
17 Powerful Integrations Your Next-Gen MLM Software Needs
Navsoft: AI-Powered Business Solutions & Custom Software Development
Autodesk AutoCAD Crack Free Download 2025
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
AutoCAD Professional Crack 2025 With License Key
history of c programming in notes for students .pptx
Advanced SystemCare Ultimate Crack + Portable (2025)
Operating system designcfffgfgggggggvggggggggg
Download FL Studio Crack Latest version 2025 ?
Complete Guide to Website Development in Malaysia for SMEs
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Odoo Companies in India – Driving Business Transformation.pdf
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
L1 - Introduction to python Backend.pptx
Monitoring Stack: Grafana, Loki & Promtail
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM

Micro Soft Access - Working with Fields

  • 1. CHAPTER 4 Working with Fields Each table consists of one or more fields. In this chapter, you learn about field properties and how to set properties such as the field size, caption, format, and default value. You also learn how to create input masks and validation rules to help reduce data-entry errors.
  • 2. Understanding Field Properties . . . . . . . . . . . . . . 64 Understanding Field Sizes . . . . . . . . . . . . . . . . 65 Change a Field Size . . . . . . . . . . . . . . . . . . . . 66 Set a Field Caption . . . . . . . . . . . . . . . . . . . . 67 Set a Field’s Format . . . . . . . . . . . . . . . . . . . 68 Set a Default Value . . . . . . . . . . . . . . . . . . . . 70 Make a Field Required . . . . . . . . . . . . . . . . . . 71 Index a Field . . . . . . . . . . . . . . . . . . . . . . . 72 Align Data within a Field . . . . . . . . . . . . . . . . . 73 Create an Input Mask . . . . . . . . . . . . . . . . . . . 74 Create a Validation Rule . . . . . . . . . . . . . . . . . 76 Create a Record-Level Validation Rule . . . . . . . . . . . 78
  • 3. 64 When you create a table, you define each field with data such as the field name, data type, and an optional description. These are examples of the field’s properties, which are a collection of data that defines the field and controls how it works. Each field has several other properties, including its size, the caption that appears as the field’s datasheet heading, and the format that the field uses to display its data. Other properties define rules for making entries, such as specifying whether an entry is required or restricting an entry to certain values. Understanding Field Properties A Properties pane When a field is selected in the Design view, its properties appear in the lower pane. B General tab The General tab contains most of the properties that you will work with. C Lookup tab The Lookup tab is primarily for setting up lookup lists. D Drop-down lists Some properties have drop-down lists from which you can make a selection; click to open the list. Other fields have builder buttons ( ), which open a dialog box that guides you through the process of building an entry. E Property information When the insertion point is in a property’s box, information about that property appears here. F Yes/No properties Some properties represent yes/no questions; these are typically already filled in with default values.
  • 4. 65 CHAPTER 4 Each field has a size that limits the amount of data you can store in it. There are different ways of expressing the field size depending on the type of field. The following table lists the specifications for the data types for which Field Size is a configurable setting. Many field types do not allow you to set a field size. For a numeric field, the advantage of choosing a field size that takes up fewer bytes is that it results in a smaller database file. The file size difference becomes more apparent the more records the table contains. Understanding Field Sizes Field Type Default Size Notes Text 255 characters You can specify any number of characters from 0 to 255. Each character occupies 1 byte of disk space. Number Long Integer The choice of number format determines the number of bytes used to store it: Byte: Integers from 0 to 255 (1 byte). Integer: Integers from -32,767 to +32,767 (2 bytes). Long Integer: Integers from -2,147,483,648 to +2,147,483,647 (4 bytes). Single: Integers from -3.4 x 1038 to +3.4 x 1038 and up to 7 significant digits (4 bytes). Double: Floating-point numbers from -1.797 x 10308 to +1.797 x 10308 and up to 15 significant digits (8 bytes). Replication ID: A globally unique identifier (GUID), such as a randomly generated ID number (16 bytes). Decimal: Integers with a defined decimal precision with values between -1028 and +1028 . The default precision is zero, and the default number of decimal places displayed is 18. AutoNumber Long Integer The same as Number, except there are only two choices: Long Integer or Replication ID.
  • 5. 66 For the Text Data Type 1 In the Design view, click in the field that you want to change. The properties for that field appear. 2 Click in the Field Size row on the General tab. 3 Type a new field size. Note: The field size for a text field is expressed as a number of characters. Access changes the field size. For the Number Data Type 1 In the Design view, click in the field that you want to change. The properties for that field appear. 2 Click in the Field Size row. 3 Click the Field Size and then click the field size that you want. Note: For a numeric field, size is expressed as a number type. See the section “Understanding Field Properties” for details. Access changes the field size. Change a Field Size If you are working with a field that offers a configurable field size, it is best to set the field’s size to as small a value as possible, while still being large enough to accommodate all possible entries. This is the most efficient course because it keeps the database file size to a minimum. If your table will contain just a few entries, its field sizes will not make that much difference. However, the difference in file size becomes more pronounced as more records are stored in the table. Change a Field Size
  • 6. 67 CHAPTER 4 A When you display the table’s datasheet, the field’s caption appears as its column heading. Note: To check the caption in a datasheet, click the Save button ( ) to save it and then switch to the Datasheet view. 1 In the Design view, click in the field for which you want to set a caption. The properties for that field appear. 2 Click here and type a caption. Note: The caption can include spaces and symbols and can have up to 255 characters. Set a Field Caption Afield’s caption is the text that appears as the field’s heading in the Datasheet view, and the default caption is the field name. For example, if you name a field OrderDate, the text “OrderDate” appears as the field’s datasheet heading. You can specify captions for fields that are different from their actual names. For example, if you have a field called LastName, you can set up its caption to appear as “Last Name” with a space between the words, which is easier to read. Captions appear not only in datasheet headings, but also on labels in forms and reports. Set a Field Caption
  • 7. 68 B For Date/Time data types, the choices appear as date/ time formats. 1 In the Design view, click in the field that you want to change. The properties for that field appear. 2 Click the Format and then click the format that you want to apply to the field. A For a Number or AutoNumber field, the choices represent different number types, such as General, Currency, and Percent. Set a Field’s Format Afield’s format determines how Access displays the field’s data. In a field that contains dates, for example, you could display the dates using the format 12/25/2013, 25-Dec-13, or Wednesday, December 25, 2013. You can change a field’s format to update its appearance in datasheets, forms, and reports. The field format is most significant for fields that store data numerically, such as Number, Currency, and Yes/No. For example, if you have a field that contains sales tax values, you might prefer to display those numbers as percentages, such as 5%, rather than decimal values, such as 0.05. Set a Field’s Format
  • 8. 69 CHAPTER 4Working with Fields TIP Why is the Format list blank for some fields? Many of the Access data types have no preset formats, so the Format list for those fields is blank. Data types that show a blank Format list are Short Text, Long Text, and Hyperlink. Other data types have no data format at all, so those fields do not even display the Format list. Data types that do not display the Format list are OLE Object and Attachment. D For a Calculated field, all the choices from all the other field types are available because Access cannot automatically determine what type of data it will hold. C For Yes/No fields, the choices appear as ways of expressing yes or no.
  • 9. 70 A When you display the table’s datasheet, the default value appears in new records. Note: The default value does not automatically populate existing records. 1 In the Design view, click in the field for which you want to set a default value. The properties for that field appear. 2 Click here and type a default value. Note: When you move away from the text box, Access automatically adds quotation marks around what you typed if the field type is Text. Set a Default Value You can speed up data entry for fields that usually contain the same value by making that value the default. For example, suppose that you have a table that includes a PaymentType field, which can take values such as Cash, Check, and Credit Card. If most of your clients pay by credit card, you can make Credit Card the default value in the PaymentType field. When you have specified a default value for a field, each time you start a new record, Access automatically fills in the field with that value. Set a Default Value
  • 10. 71 CHAPTER 4 When you enter a new record in the table, a warning appears if you do not enter a value in that field. A Click OK to clear the error and then type a value in the required field. 1 In the Design view, click in the field that you want to make required. The properties for that field appear. 2 Click the Required and then click Yes. Make a Field Required In many tables, one or more fields must be filled in for each record. For example, in a Customers table, the CompanyName field should be filled in for each record. To ensure that a particular field is always filled in with data, you can configure the table to make the field required. When a field is required, Access does not enable users to skip it during data entry. The primary key field is always required for each record in a database, but you can also make other fields required without changing the primary key setting. Make a Field Required
  • 11. 72 1 In the Design view, click in the field that you want to index. The properties for that field appear. 2 Click the Indexed and then click Yes (Duplicates OK). This sets the field to be indexed without forcing entries in it to be unique. A You can choose Yes (No Duplicates) if you prefer that records have unique entries for that field. If you chose Yes (No Duplicates) and you then try to enter an identical value for two records, an error message appears. B Click OK to clear the message and then correct the error. Index a Field When you perform searches on a database that contains many records, a delay can occur as Access searches. To minimize searching delays, you can set a field to be automatically indexed, which means that Access gathers extra data about the field that enables it to locate data in the field extremely fast. Searches based on that field will take place more quickly. The two types of indexing are Yes (Duplicates OK) and Yes (No Duplicates). The latter has the side effect of forcing each record to have a unique value for that field, as with the primary key field. Index a Field
  • 12. 73 CHAPTER 4 A The next time that you display the datasheet, Access applies the selected alignment to the field. 1 In the Design view, click in the field whose data you want to align. The properties for that field appear. 2 Click the Text Align and then click the alignment that you want. Align Data within a Field You can make your tables easier to read by aligning text and numbers within a field. By default, Access uses the General alignment, which means that it aligns numbers with the right side of the field and text with the left side of the field. For any field, you can choose the Left or Right alignment, or you can choose Center, which aligns data with the center of the field. Excel also offers a Distribute alignment, which adds space between each character so that the field data is aligned with both the left and right side of the field. Align Data within a Field
  • 13. 74 The Input Mask Wizard opens. 4 Click the type of input mask that you want. A To try the mask, you can click in the Try It box and then type a sample entry. 5 Click Next to customize the mask. B If you do not want to customize the mask, click Finish. 1 Click in the field for which you want to create an input mask. The properties for that field appear. 2 Click in the Input Mask row. 3 Click the Build icon ( ). Create an Input Mask Amajor database problem is data entered inconsistently, such as phone numbers entered as (123)555-6783 and 123-555-6783. You can help prevent such inconsistencies by applying an input mask to the field. An input mask is a kind of template that shows users how to enter the data and prevents them from entering incorrect characters, such as a letter where a number is required. For example, here is an input mask for a phone number: (___)___-____. Each underscore (_) acts as a placeholder for (in this case) a digit, and the parentheses and dash appear automatically as the user enters the number. Create an Input Mask
  • 14. 75 CHAPTER 4Working with Fields TIP What do the input mask characters mean? Input masks use characters to represent the types of data that they will accept. The following table shows the most commonly used characters. For more characters, look up “Input Mask Character Reference” in Access Help. Character Use Character Use 0 Single digit, required A Single letter or number, required 9 Single digit, optional a Single letter or number, optional # A digit, space, plus sign, or minus sign & Any character or a space, required L Single letter, required C Any character or a space, optional ? Single letter, optional 9 Click how you want the data to be stored ( changes to ): With the symbols in the mask: The extra symbols (such as the parentheses and dash in a phone number mask) are stored along with the data. Without the symbols in the mask: The extra symbols are not stored with the data. 0 Click Finish. The input mask code appears in the Input Mask row in the field’s properties. 6 Modify the input mask’s code if you want to. 7 Click the Placeholder character to select a different placeholder character if necessary. C To try the mask, you can click in the Try It box and then type a sample entry. 8 Click Next.
  • 15. 76 The Expression Builder dialog box opens. 4 Enter the expression that represents the criteria you want to specify. 5 Click OK. Note: You could have simply typed the validation rule into the row and skipped steps 3 to 5, but the Expression Builder’s tools can be useful for complex expressions. Create the Rule 1 In the Design view, click in the field for which you want to create a validation rule. The properties for that field appear. 2 Click in the Validation Rule row. 3 Click . Create a Validation Rule Although an input mask helps a user enter data into a field using the proper number and type of characters, it cannot restrict the field to certain entries based on logic. A better solution for preventing data-entry errors is the data validation feature. With data validation, you create validation rules that specify exactly what kind of data can be entered in a field and in what range that data can fall. You can also specify an error message that appears when a user enters data that does not satisfy a validation rule. Create a Validation Rule
  • 16. 77 CHAPTER 4Working with Fields TIP How do I use the Expression Builder? The Expression Builder can guide you in determining the correct syntax for an expression. There are many types of expression content available, including functions, constants, and operators. For example, to enter the expression from the steps in this section (>0) ,you would do the following: 1 Click Operators. 2 Click Comparison. 3 Double-click >. A The > character appears in the expression at the top of the dialog box. 4 Type 0. 5 Click OK. Test the Rule B When the rule is violated, a custom error message appears, containing the text that you specified in the Validation Text row. 1 Click OK and then retype the field entry. A The validation rule appears in the Validation Rule row. 6 Type the text for the error message in the Validation Text row.
  • 17. 78 1 In the Design view, click the Design tab. 2 Click Property Sheet. The Property Sheet for the entire table appears. 3 Click in the Validation Rule box and type the expression. 4 Click here and type the error message text. 5 Click Test Validation Rules. If the table contains data already, a warning appears that the data must be checked. 6 Click Yes. Create a Record-Level Validation Rule Although most validation rules involve a single field in the table, you can create rules that involve two or more fields. For example, a rule might compare the value of one field with another. This is called a record-level validation rule because it involves multiple fields in each record. For example, in an Orders table, you could set up a record-level validation rule that checks to make sure that the Order date is before (or the same as) the Shipped date because an order cannot be shipped before it is placed. Create a Record-Level Validation Rule
  • 18. 79 CHAPTER 4Working with Fields TIPS How do I construct a validation rule that contains field names? You can either use the Expression Builder or type field names directly into the expression. To use the Expression Builder, click in the Validation Rule box and click to open the Expression Builder. Click the table name in the Expression Elements list. Double-click each field to which you want to add to the expression in the Expression Categories list. Click OK. To enter field names directly into the Validation Rule box, enclose each one in square brackets: [OrderDate]. What happens to existing data that violates the validation rule? Nothing happens to it; it is allowed to continue to exist. However, new records will not be permitted to violate the rule, and if you ever edit the record that violates the rule, you will not be able to save changes to it until you fix the violation. If existing data violates the new rule, another warning appears. You can either keep the new rule or change it if this happens. 8 Click Yes to keep the new rule, even if some existing data violates it. A You can also click No to go back to the previous rule (if any). A confirmation dialog box opens. 9 Click OK. The check is complete. If the table has not been saved, a prompt appears to save it. 7 Click Yes.