Ms Access Instructions
Ms Access Instructions
Microsoft Access provides two primary views for working with database objects such as tables, queries, forms, and
reports Design View and Datasheet View.
1 Views
1.1 Design View
Design View is a mode in Microsoft Access where you can create, modify, and design the structure and
properties of database objects. It is used for designing the layout, defining fields, setting properties, and
establishing relationships between objects.
Features
• In Design View, you can see the underlying structure of the object and make detailed changes.
• For tables, you can add fields, set data types, specify field properties (e.g., captions, default values,
validation rules), and define primary keys)
• In queries, you can design criteria, joins, calculated fields, and sorting options to retrieve specific data
sets.
• For forms and reports, Design View allows you to customize the layout, add controls (e.g., text boxes,
buttons), set properties, and configure data sources.
Features
• In Datasheet View, you can see the actual data stored in the database and perform data entry, editing,
sorting, and filtering tasks.
• For tables, Datasheet View shows all records and fields in a grid format, allowing users to add, modify,
or delete data rows.
• In queries, Datasheet View displays the results of the query based on specified criteria and allows users
to work with the data interactively.
• For forms, Datasheet View provides a way to view and edit multiple records at once, similar to a
spreadsheet, making data management more efficient.
• Design View is more focused on the layout, properties, and relationships of objects, whereas Datasheet
View is focused on displaying and editing actual data.
Page 1 of 5
• Changes made in Design View affect the structure and design of objects, while changes in Datasheet
View affect the data displayed without altering the object's structure.
2 Objects
2.1 Tables
• Use meaningful and descriptive field names to improve data clarity and usability.
• Set appropriate data types for each field (e.g., Text, Number, Date/Time) to ensure data integrity.
• Define primary keys for unique identification and to establish relationships with other tables.
• Consider using input masks and validation rules to enforce data consistency and accura
2.2 Forms
• Design forms with a user-friendly layout, placing related fields together for easy data entry and
navigation.
• Utilize form controls like buttons, combo boxes, and tabs to enhance functionality and user
interaction.
• Implement data validation and error handling to guide users and prevent incorrect data entry.
• Customize form properties such as default values, tab order, and form views (single, continuous,
datasheet) for improved usability.
• Create subforms to display related data from multiple tables in a single form, enhancing data
organization and user experience.
2.3 Queries
• Use parameter queries to prompt users for input criteria, making queries more dynamic and flexible.
• Combine multiple tables using joins (e.g., inner join, left join) to retrieve data based on relationships
between tables.
• Utilize calculated fields in queries to perform calculations or derive new data based on existing
fields.
• Group and summarize data using aggregate functions (e.g., Sum, Avg, Count) to generate
meaningful insights and reports.
• Optimize query performance by indexing fields used in criteria or joins and avoiding unnecessary
calculations or subqueries.
2.4 Reports
• Design reports with a clear and organized layout, including headers, footers, and grouping for better
readability.
• Use report controls like labels, text boxes, and images to present data and visual elements effectively.
Page 2 of 5
• Incorporate sorting and grouping to organize data hierarchically and provide a structured view of
information.
• Apply formatting options such as colors, fonts, and borders to enhance the visual appeal of your reports.
• Preview and print reports to ensure they meet the desired presentation and formatting requirements
before distribution.
3 Important Tips
3.1 Input Masks
• An input mask in Microsoft Access is a feature that helps control the data format users can enter into a
text field.
• It's particularly useful when you want to ensure consistency and accuracy in data entry by enforcing a
specific pattern or format.
• Input masks are commonly used for fields like phone numbers, dates, social security numbers, postal
codes, and other structured data. Input masks are used to guide users in entering data by displaying
placeholders for each character position in a field.
• They help maintain data integrity by ensuring that entered values match a predefined format, reducing
errors and inconsistencies.
? Letter or space
A Letter or digit
3.1.2 Examples
• Phone Number: An input mask for a phone number might look like "(999) 999-9999" to ensure
users enter numbers in the format (XXX) XXX-XXXX.
• Date: For a date field, the input mask "99/99/9999" could be used to prompt users to enter
dates in the format MM/DD/YYYY.
Page 3 of 5
• Postal Code: An input mask such as "L0L 0L0" guides users to enter postal codes in the format
LNL NLN (where L is a letter and N is a digit).
• Social Security Number: An input mask like "000-00-0000" enforces the format of a social
security number with three digits, followed by a hyphen, then two digits, another hyphen, and
four digits.
• In table design view, select the desired text field, go to the "General" tab in the Field Properties
pane, and set the "Input Mask" property to the desired format.
• In form design view, select the text box control, go to the "Data" tab in the Property Sheet, and
set the "Input Mask" property to the desired format.
• When users enter data in a field with an input mask, Access automatically formats the input
according to the specified mask.
• Input masks can include literal characters (such as parentheses, hyphens, spaces) along with
format characters, providing visual cues for users.
• Users can only enter data that matches the format specified by the input mask; otherwise,
Access displays an error or rejects the input.
• Range Validation: Checks if the entered value falls within a specified range of values (e.g.,
numeric range, date range).
• Format Validation: Verifies that the entered data follows a specific format or pattern (e.g.,
phone number, email address, postal code).
• Custom Validation: Allows you to define custom criteria or expressions for validating data based
on your specific requirements.
Page 4 of 5
3.2.2 Setting Up Validation Rules in Access
• Table Design View: In Microsoft Access, you can set validation rules for fields in table design
view.
3. Set the "Validation Rule" property to specify the validation criteria or expression (e.g.,
>0 for positive numbers, Like "###-##-####" for social security numbers).
4. Optionally, set the "Validation Text" property to provide a custom error message that
appears when the validation rule is violated.
• Form Design View: You can also apply validation rules to form controls in form design view.
1. Select the text box, combo box, or other control that you want to validate.
3. Set the "Validation Rule" property to define the validation criteria or expression.
• If the entered data violates the validation rule, Access displays the custom error message (if
provided) or a default error message, preventing the record from being saved or updated until
valid data is entered.
• Data validation rules help maintain data consistency, accuracy, and reliability by enforcing
standards and preventing invalid or inappropriate data entry.
• Range Validation: Allow dates between January 1, 2022, and December 31, 2023, in a
"OrderDate" field.
Page 5 of 5