240 likes | 250 Views
Grauer and Barber Series Microsoft Access Chapter Two. Case Study: A Student Database. Database development Include all of the necessary data Review output to determine input Store data through objects via separate table structures Do not specify calculated fields. Creating a Table.
E N D
Grauer and Barber Series Microsoft Access Chapter Two Microsoft Access
Case Study: A Student Database • Database development • Include all of the necessary data • Review output to determine input • Store data through objects via separate table structures • Do not specify calculated fields Microsoft Access
Creating a Table • Two ways to define a table structure • Wizard or Design view (scratch) Design Wizard Microsoft Access
Identify table structure • Indicate the name of the field • Can be up to 64 characters in length, including letters, numbers, and spaces • Indicate Data type • Number field Text field • Memo field Data/Time • Currency Yes/No • OLE Object AutoNumber • Hyperlink Microsoft Access
Identify Primary key in table structure • Indicate the primary key for the table • Primary key is unique for each record • Examples of a Primary key include • employee numbers and social security number • bank account numbers and student numbers Microsoft Access
Table Views • Datasheet view – shows data in matrix format • Design view – allows for modifications to the table structure or outline Design View Datasheet View Microsoft Access
Properties • Properties contain attributes about database fields • These include items such as: • Field size Format property • Input Mask Caption property • Caption Property Default Value • Validation Required Property • Allow zero Length Indexed Property Microsoft Access
Properties Field Properties Microsoft Access
Hands-On Exercise One • Start Microsoft Access using start, programs, Microsoft Access • Choose a new database using Blank Access Database • Save the new database in your Exploring Access Folder with a filename of My First Database • Click tables, new, table wizard • Choose the fields to include in table Microsoft Access
Hands-On Exercise One • Follow the wizard questions and indicate • Name of table and Primary key • Add additional fields to include in database • Indicate the primary key and additional properties of fields (field size, for example) • Use View, datasheet view to enter records into newly created table. • Use File, Print to print the table • Use File, Exit to leave Access (leave disk in drive a when using File, exit command, then retrieve disk) Microsoft Access
Forms • Form allows for an easy way to enter and display data • Data in form is stored in underlying table • Form has two views • Form view – shows actual form with data • Design view – allows for changes to be made to form Microsoft Access
Controls • Forms contain controls. • Three types of controls • Bound – data source is a field in table (text boxes) • Unbound – no data source – examples include titles, labels, lines, graphics, or pictures • Calculated Control – calculated item using arithmetic operators Microsoft Access
Forms Design/Form/DataSheet Views Unbound Control Bound control Calculated Microsoft Access
Properties • We can change the properties of an object • Right-clicking an object brings shortcut menu to allow for changes Short-cut Menu Microsoft Access
Form Wizard • Use the Form Wizard to create the form • System will prompt as to process in creating form • Other ways to create a form include • Design View (Create form from scratch) • AutoForm: Columnar • AutoForm: Tabular • AutoForm: Datasheet Microsoft Access
Creating a Form Ways to Create Form Menus are similar for creating other objects Form Object Microsoft Access
Hands-On Exercise Two • Use File, New and create a new database (.mdb extension) • Use Forms, New, Form Wizard and indicate name of table or query to to create a new form from • Follow the prompts and select your choices, including, fields, layout, and style • Save the form and modify the design form • Click various controls on the design view and make necessary changes • Add a calculated control on the form Microsoft Access
Hands-On Exercise Two • Right-click various objects on the design form and make necessary changes • Use the view button to switch to form view and add a new record. • Use File, Save to save changes • Use File, Close to close the form • Use File, exit to exit Access Microsoft Access
Add new fields to table Structure • Open database and choose tables button • Indicate table to open • Use Design view and • Change table structure Table Object Table Students available Microsoft Access
Adding fields and controls to a Form Toolbox Added to Form Lookup Wizard Added to Form Option Group Button Added to Form Microsoft Access
Adding a Command Button Command Button Operations for button Microsoft Access
Hands-On Exercise Three • Use File, Open and open a database • Click the tables button and choose the student table • Use View, design menu or design button to open the table structure • Add new fields to the table structure • Lookup Wizard data type • Use the save button to save table structures changes Microsoft Access
Hands-On Exercise Three • Choose the forms button and choose the student form • Use the design to open the format of the form • Click and drag fields from field list to area on screen • (System will add unbound and bound control for the field) • Use the Toolbox toolbar and add an option group button for campus field • Use the Toolbox toolbar and add a command button Microsoft Access
Hands-On Exercise Three • Use File, Page Setup to change page setttings • Click the form object and choose the students form • Use the add record command button and add a record to the underlying table • Use File, Print to print the current record • Use Close Form command button to close the form • Use File, Exit to leave Access Microsoft Access