Access Tutorial 6: Form Fundamentals



Similar documents
Access Tutorial 13: Event-Driven Programming Using Macros

Microsoft Access Tutorials: Table of Contents

Access Tutorial 8: Combo Box Controls

Giving users forms instead of tables lets them enter and manipulate data while protecting the tables structure (field properties, etc.).

Microsoft Access 2010 handout

Access 2007 Creating Forms Table of Contents

Using Microsoft Access

A database is a collection of data organised in a manner that allows access, retrieval, and use of that data.

Access Tutorial 4: Basic Queries Using QBE

Access Tutorial 2: Tables

MICROSOFT ACCESS A. CREATING A DATABASE B. CREATING TABLES IN A DATABASE

Instructions for Creating Silly Survey Database

Access Tutorial 11: Action Queries

Excel Pivot Tables. Blue Pecan Computer Training Ltd - Onsite Training Provider :: :: info@bluepecan.co.


Writer Guide. Chapter 15 Using Forms in Writer

Creating forms in Microsoft Access 2007

Microsoft Access 2010 Overview of Basics

Chapter 15 Using Forms in Writer

Access Tutorial 9: Advanced Forms

Microsoft Access GUI Building

ECDL. European Computer Driving Licence. Spreadsheet Software BCS ITQ Level 2. Syllabus Version 5.0

Microsoft Access 2000

Excel basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

Formatting & Styles Word 2010

Introduction To Microsoft Office PowerPoint Bob Booth July 2008 AP-PPT5

Using the SAS Enterprise Guide (Version 4.2)

Database File. Table. Field. Datatype. Value. Department of Computer and Mathematical Sciences

SQL Server 2005: Report Builder

Microsoft Access 2010 Part 1: Introduction to Access

Reviewing documents with track changes in Word 2013

MICROSOFT ACCESS 2007 BOOK 2

Statgraphics Getting started

Using Microsoft Access

Sample Table. Columns. Column 1 Column 2 Column 3 Row 1 Cell 1 Cell 2 Cell 3 Row 2 Cell 4 Cell 5 Cell 6 Row 3 Cell 7 Cell 8 Cell 9.

Microsoft Access Basics

Utilizing Microsoft Access Forms and Reports

Creating a Database in Access

Adobe Acrobat X Pro Creating & Working with PDF Documents

Creating a Form. A form is something that is created allowing users to enter information in a more visual manner than a datasheet view.

Access Part 2 - Design

Simple Invoicing Desktop Database with MS Access c 2015 by David W. Gerbing School of Business Administration Portland State University

A More Advanced Database Illustration Access 2010

MICROSOFT ACCESS 2003 TUTORIAL

INTRODUCTION TO MICROSOFT ACCESS MINIMAL MANUAL

Create a New Database in Access 2010

Quick Start Guide. Microsoft Publisher 2013 looks different from previous versions, so we created this guide to help you minimize the learning curve.

Introduction to. Microsoft Access Practicals

MS Access. Microsoft Access is a relational database management system for windows. Using this package, following tasks can be performed.

Creating tables of contents and figures in Word 2013

Creating tables in Microsoft Access 2007

Introduction to Microsoft Access XP

Word basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

Task Force on Technology / EXCEL

ACCESS 2007 BASICS. Best Practices in MS Access. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

Writer Guide. Chapter 15 Using Forms in Writer

Crystal Reports Payroll Exercise

Monthly Payroll to Finance Reconciliation Report: Access and Instructions

Making Visio Diagrams Come Alive with Data

Merging Labels, Letters, and Envelopes Word 2013

Using an Access Database

Presentations and PowerPoint

Microsoft Excel Basics

Acrobat PDF Forms - Part 2

Microsoft Office Access 2007 Basics

Mail Merge (Microsoft Office 2010)

User Services. Microsoft Access 2003 II. Use the new Microsoft

Introduction to Microsoft Access 2003

Acrobat X Pro Accessible Forms and Interactive Documents

Planning and Creating a Custom Database

Adobe Acrobat: Creating Interactive Forms

Learning Services IT Guide. Access 2013

Microsoft Access Introduction

Excel 2007 Basic knowledge

Creating trouble-free numbering in Microsoft Word

Lesson 07: MS ACCESS - Handout. Introduction to database (30 mins)

Advanced Word for Windows

Entering the example employee satisfaction survey in Survey Crafter Professional s Survey Designer window

Mail Merge Creating Mailing Labels 3/23/2011

SECTION 5: Finalizing Your Workbook

Hands-on Practice. Hands-on Practice. Learning Topics

Objectives. Understand databases Create a database Create a table in Datasheet view Create a table in Design view

BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

Database Forms and Reports Tutorial

9 CREATING REPORTS WITH REPORT WIZARD AND REPORT DESIGNER

8 CREATING FORM WITH FORM WIZARD AND FORM DESIGNER

Introduction to Word 2007

Introduction to Microsoft Access 2010

Access Tutorial 1 Creating a Database

Creating Calculated Fields in Access Queries and Reports

Timeless Time and Expense Version 3.0. Copyright MAG Softwrx, Inc.

Introduction to Microsoft Access 2013

EXCEL PIVOT TABLE David Geffen School of Medicine, UCLA Dean s Office Oct 2002

ECDL. European Computer Driving Licence. Database Software BCS ITQ Level 1. Syllabus Version 1.0

Using Clicker 5. Hide/View Explorer. Go to the Home Grid. Create Grids. Folders, Grids, and Files. Navigation Tools

Windows XP Pro: Basics 1

Transcription:

Access Tutorial 6: Form Fundamentals 6.1 Introduction: Using forms as the core of an application Forms provide a user-oriented interface to the data in a database application. They allow you, as a developer, to specify in detail the appearance and behavior of the data on screen and to exert a certain amount of control over the user s additions and modifications to the data. Like queries, forms do not contain any data. Instead, they provide a window through which tables and queries can be viewed. The relationship between tables, queries, and forms is shown in Figure 6.1. In this tutorial, we are going to explore the basic elements of form creation using Access form design tools. In subsequent tutorials, we will extend the functionality and ease-of-use of our basic forms with subforms (Tutorial 7), combo box controls (Tutorial 8), and triggers (Tutorial 13). FIGURE 6.1: The relationship between forms, queries, and tables. Courses Departments Employees 6.2 Learning objectives Do forms contain data? How do I create a form? forms queries tables Michael Brydon (brydon@unixg.ubc.ca) Last update: 24-Aug-1997 Home Previous 1 o f 15

How do I make the contents of a field on a form read-only? What is an unbound text box? How do I create one? How do I create a form using the form wizard? What is the difference between a columnar (single-column) and tabular form? 6.3 6.3.1 Creating a form from scratch Although Access provides an excellent wizard for creating simple forms, you will start by building a form from scratch. This will give you a better appreciation of what it is the wizard does and provide you with the basic knowledge needed to customize and refine the wizard s output. Create a new blank form based on the Courses table, as shown in Figure 6.2. The basic elements of the design screen are shown in Figure 6.3. Use the View menu to display the toolbox and field list if they are not already visible. 6.3.1.1 Adding bound text boxes Add a bound text box for the DeptCode field by dragging DeptCode from the field list to the form background, as shown in Figure 6.4. Reposition the DeptCode text box in the upper left of the form. Remember that you can always use the undo feature to reverse mistakes. Select Edit > Undo from the menu or simply press Control-Z (this works the same in virtually all Windows applications). Home Previous 2 o f 15

FIGURE 6.2: Create a new form to display data from the Courses table. Select the Forms tab from the database window. Select Design View (do not use the wizard at this point) Bind the form to the Courses table. Since you can build a form on top of a table or a query, both are shown in this list (here is where a meaningful naming convention starts to pay off) Home Previous 3 o f 15

FIGURE 6.3: The basic elements of the form design screen. To change the size of the form, drag the edges of the detail section. The field list shows the fields in the table or query to which the form is bound. The toolbox the icons in the toolbox are used to create graphical items and controls on the form. If the field list and toolbox are not displayed, use the View menu or toolbar icons. Home Previous 4 o f 15

FIGURE 6.4: Create a bound text box for the DeptCode field. Access uses the field s caption property as the default label for the text box. If no caption is specified, the field name (e.g., DeptCode) is used. To save time editing labels, choose your captions with this feature in mind. Drag the highlighted field on to the form s detail section. To move an object and its label, drag the center of the object (the cursor becomes a white arrow). To move just the object or just the label, drag the upper left handle (the cursor becomes a pointing finger). Select the DeptCode field in the field list. Home Previous 5 o f 15

Drag the remaining fields on to the form, as shown in Figure 6.5 (do not worry about whether the fields are lined up perfectly). Select View > Form to see the resulting form. Alternatively, press the form view icon ( ). Select View > Form Design or press the design view icon ( ) to return to design mode. 6.3.1.2 Using a field s properties to protect its contents Every object on an Access form (e.g., text box, label, detail section, etc.) has a set of properties that can be modified. In this section, you are going to use the Locked and Enabled properties to control the user s ability to change the information in a field. Select the DeptCode text box and right-click to bring up its property sheet, as shown in Figure 6.6. Scroll down the property sheet to the Locked property and set it to Yes, as shown in Figure 6.7. Switch to the form view and attempt to change the contents of the DeptCode field. A stronger form of protection than locking a field is disabling it. Return to design mode and make the following changes: reset the Locked property to No; set the Enabled property to No. Attempt to change the contents of the DeptCode field in form view, as shown in Figure 6.8. Save the form as frmcourses. 6.3.1.3 Adding an unbound text box All the text boxes created in the previous section were bound text boxes that is, they were bound to a field in the underlying table or query. When you change the value in a bound text box, you are mak- Home Previous 6 o f 15

FIGURE 6.5: Add the text boxes and switch to form view to see the resulting form. Text boxes are simply windows on to the fields in the underlying table. Add the remaining fields to the form. Select View > Form from the main menu to view the form. You can add more than one field to the form with one drag-and-drop operation by holding down the Control button when selecting the fields from the field list. Home Previous 7 o f 15

FIGURE 6.6: Bring up the property sheet for the DeptCode text box. Right-click once on the selected object to get the pop-up menu. Select Properties to get the property sheet. Select the object (e.g., the DeptCode text box) for which you wish to see the properties. When an object has been selected, it is bordered by six dark handles. The properties are broken down into four groups. To see all the properties, select the All tab. Some properties of the text box (such as input mask) are inherited from the field to which the text box is bound. Home Previous 8 o f 15

FIGURE 6.7: Change the Locked property of DeptCode to Yes. Use the scroll bar to find the Locked property. ing the change directly to the data in the underlying table. It is possible, however, to create objects on forms that are not bound to anything. Although you will not use many unbound text boxes in the assignment, it is instructive to see how they work. Create a new empty form bound to the Courses table and save it using the name frmcoursesub. Select the text box tool ( ) from the toolbox and create and unbound text box, as shown in Figure 6.9. 6.3.1.4 Binding an unbound text box to a field The only difference between a bound and an unbound text box is that the Control Source property of a bound text box is set to the name of a field. In this section, you are going to change the unbound text box shown in Figure 6.9 to a bound text box. Home Previous 9 o f 15

FIGURE 6.8: Set the Enabled property of DeptCode to No and attempt to change the value in the field. Set Locked to No and Enabled to No. Switch to form view to see the result. When a form object is disabled, it cannot receive the focus (that is, you cannot put the cursor on it). By default, disabled form objects are greyed out. To override this feature, set the Locked property to Yes and the Enabled property to No. Home Previous 10 o f 15

FIGURE 6.9: Create an unbound text box. Select the text box tool from the toolbox. The cursor becomes a small text box. Click anywhere on the detail section to create a new unbound text box. Bring up the property sheet for the unbound text box. Change its Control Source property from null to DeptCode, as shown in Figure 6.10. 6.3.2 Creating a single-column form using the wizard Now that you understand the basics of creating and modifying bound text boxes, you can rely on the form wizard to create the basic layout of all your forms. Create a new form bound to the Courses table using the form wizard, as shown in Figure 6.11. Use the form wizard to specify the fields you want on your form and the order in which they appear, as shown in Figure 6.12. Select columnar when prompted for the form type. Columnar forms are called single column forms in version 2.0. Home Previous 11 o f 15

FIGURE 6.10: Set the Control Source property of an unbound text box. FIGURE 6.11: Create a new form using the form wizard. Select the form wizard. Bind the form to the Courses table. Use the pull-down list to set the Control Source property to DeptCode. Home Previous 12 o f 15

FIGURE 6.12: Use the form wizard to determine the order of fields on your form. to show a field, either doubleclick it or press the > button. The order in which the fields appear in this pane is the order in which they will appear on the form. Use the < and << buttons to move fields back to the pane on the left. To show all the fields, press the >> button. Home Previous 13 o f 15

The primary advantage of the wizard is that it automatically creates, formats, and aligns the bound text boxes. Of course, once the wizard has created a form, you are free to modify it in any way. If you make a mistake when creating a form (e.g., you put the fields in the wrong order) it is often easier to use the wizard and start over than to fix the problem manually. 6.4 Discussion Discussion look and behavior of the data. The three different types of forms are shown in Figure 6.13. 6.5 Application to the assignment Use the wizard to create columnar forms for all your master tables. Note that in some cases (e.g., BackOrders) you will want to base the form on a join query rather than table in order to show important information such as CustName and ProductName. 6.4.1 Columnar versus tabular versus datasheet forms Columnar forms show one record per page. Tabular forms, in contrast, show many records per page and are used primarily as subforms. There is also a a datasheet form type, but it is seldom used since it gives the developer relatively little control over the Home Previous 14 o f 15

Application to the assignment FIGURE 6.13: The same information displayed as a columnar, tabular, and datasheet form. A columnar form displays one record per page. A tabular form displays more than one record per page. A datasheet form is identical to the datasheet view of a table or query. Since it gives the designer very little control over the format of the data, it is generally inappropriate for use in an end-user application. Home Previous 15 o f 15