Presentation on theme: "Microsoft Access A Hands-On Introduction Chapter 2."— Presentation transcript:
Microsoft Access A Hands-On Introduction Chapter 2
2 Access Help System Extremely comprehensive. Actually a separate application. Is context sensitive. Has two main parts. Access help & VBA help. Please follow along as your instructor takes you on a guided tour.
3 Access Help System (Contd.) Open the customers table in Design View. Click anywhere in the Data Type column to select it. Press the F1 key. Notice that the Help system has opened and displayed information on the DataType property. This is how Context sensitive help works.
4 Access Help System (Contd.) When using Access, help can usually be had for the selected item by pressing F1. Thus when we selected the Data Type column by clicking on it and then pressing the F1 key, we get help on that item. This behavior is consistent across the majority of well behaved Windows programs.
5 Access Help System (Contd.) Click on Help in the Menu bar. In the dropdown, click on Microsoft Access Help. In the search box of the Answer Wizard tab, type “How do i create a database” and click the Search button. You should get help showing several ways of creating a database. Click on the one of your choice.
6 Access Help System (Contd.) Access help is a totally separate application and therefore once you open it, it is always available via the Windows taskbar as long as Access is open. The contents tab when expanded, breaks down Access into it’s various parts using a tree structure similar to Windows Explorer. Becoming familiar with the help system is time well spent.
7 Exercise 2-1 Now that you have been introduced to the Access Help system, it is only appropriate that you jump in and check it out for yourself. Refer to the Exercise Manual, Exercise 2-1. You have approximately ten to fifteen minutes.
8 Designing Your Database Application Identifying Tasks Charting Task Flow Identifying Data Elements Organizing The Data Design The Interface Construct The Application Test And Refine
9 Identifying Tasks What is the application supposed to do? What forms will be necessary? For example: Add New Customers, Create Work Orders. What reports are needed? Will it be a single or multi user system? How secure does it need to be? List all the major tasks you think you will need including those not required right away.
10 Charting Task Flow Group major tasks by topic. For example: Sales tasks, Purchasing tasks, Ordering tasks, etc. Determine the sequence of steps necessary within each group. For example: A new Vendor must be added before a Purchase order can be placed from that Vendor. This exercise if done carefully should result in a smoothly running application.
11 Identifying Data Elements Now that you have identified the necessary tasks, you need to list the data elements required by each task. An example might be a payment amount to be posted against an invoice. This task will result in a change to a data element and possibly result in a removal of the invoice if paid. Data requirements for each task must be carefully thought out so as to not have things falling through the cracks. It is imperative that your users are actively involved in this design process.
12 Organizing The Data After all the needed Data Elements are determined, they must be organized by subject. A subject is a person, place, thing or action that needs to be tracked in the application. This process will determine the necessary tables. Each Data Element will become a field in a particular table and the collection of fields will represent all the data required for a subject in the table.
13 Selecting the best data type for the job. Text Alphanumeric data. Alphanumeric data. Memo Variable-length text strings that are expected to be more than 255 characters or that may exceed that length in the future. Variable-length text strings that are expected to be more than 255 characters or that may exceed that length in the future. Number Stores numbers in various formats. Stores numbers in various formats. Date/time Used for storing and calculating dates, dates with times, or times. Used for storing and calculating dates, dates with times, or times. AutoNumber (counter) Used for unique values for primary keys. Used for unique values for primary keys. Access automatically increments the value of an AutoNumber data type when a new record is added to the table. Access automatically increments the value of an AutoNumber data type when a new record is added to the table. Currency Monetary data stored with 4 decimal places. Monetary data stored with 4 decimal places.
14 Selecting the best data type for the job (contd.) Yes/no –Represents a yes/no or true/false value –Takes only 1 bit of space OLE objects –Used for graphics, binary data, and objects from other OLE servers –This is a “freeform” data Pictures An executable file Links to OLE objects Actual files Up to 1 gigabyte in size Hyperlink –Opens Web pages –Opens local documents
15 Design The Interface The interface is what your users see, therefore they should participate in its design. Forms make up most of this interface. The “plumbing” that makes the form do its work is not necessary at this point since we are concerned with visuals only. You must demonstrate and get approval for these visuals before building in the functionality and this typically takes several sessions with your user community.
16 Constructing The Application The ultimate goal is a smooth running application and happy users. As you proceed with this step, get as much feedback from your users as possible. They are interested in your success also.
17 The Most Important Step: The Database Architecture Easy to move forward, difficult to move backward –Designing a data model (or structure) requires extensive research, planning, and development –Once designed, it is difficult to change Usually requires rebuilding –Rebuilding a model Much more difficult than using careful planning to build it correctly the first time The data model is the foundation of your application –The data structure will determine Forms Queries Reports How you work with code Index Index Form Fields Table: Actors Code Report Fields Table: Customers Macro Form Fields Table: Distributors Query Index Fields Table: Tapes Form User interface Fields Table: Movies
18 Table Design Tips for Designing Fields Example: Instead of one field called FullName, use two fields FirstName and LastName. Fields should be related to the Table subject. Do not store calculated data. It wastes space and can be calculated at run time. Avoid embedded spaces in Field Names. Field Name should be indicative of Field data. Avoid redundancy. Example: If you have FirstName, MiddleName and LastName, you do not need MiddleInitial. Normalization is the Solution.
19 To Summarize
20 Reduce Redundant Information: Normalize LastNameFirstNameMIPosition MarchJamesH Software Analyst SmithBillKAdministrator KittridgeJamieR Clerical Help McBrideAmyQ Technical Support PierceHarveyMController GastonJerryPCFO ColbergWilliamM General Manager ColomboVirginiaTCEOLastNameFirstNameMISalaryPDMarchJamesH SmithBillK KittridgeJamieR McBrideAmyQ PierceHarveyM GastonJerryP ColbergWilliamM ColomboVirginiaT Before Normalization Employee TablePayroll Table Duplicate Information Salary Pay Day
21 Reduce Redundant Information: Normalize (Contd.) LastName FirstNam e MIPositionEMP_NO MarchJamesH Software Analyst SmithBillKAdministrator39012 KittridgeJamieR Clerical Help McBrideAmyQ Technical Support PierceHarveyMController39112 GastonJerryPCFO39011 ColbergWilliamM General Manager ColomboVirginiaTCEO39656EMP_NOSalaryPD After Normalization Employee Table Payroll Table
22 Creating Tables Of the several ways to create tables in Access, the simplest is the Table Wizard. Another way is by entering data using Datasheet view. The Table Design window is also used to create and modify tables. Your instructor will now demonstrate table creation using the Table Wizard.
23 Creating Tables (Contd.) The wizard gives you two types of sample database tables. Business or Personal. Each sample contains field choices relevant to that type. It is typical to use the wizard to create most of the design and then follow up with the Table Design window to apply finishing touches.
24 Creating Tables (Contd.)
25 Creating Tables (Contd.) As you can see, the Table Design window is very simple. There are only three columns. Field Name should not contain embedded spaces and should be descriptive of field contents. Data Type is used to tell Access what kind of data is in the field. Selecting the box displays a down arrow and clicking the arrow displays the choices available. The Description field although not required is very important as it serves to document your table design. The contents of Description are also displayed in the status bar as a sort of mini-help for your users.
26 Creating Tables (Contd.) The Field Properties section at the bottom of the Design window allows you to customize the way Access handles and stores each field. You will notice that the left side of this section contains the field property names and values which are dependant on the Data Type you have selected for the field. The right side provides help for each property name. Most of the property values are selectable by making choices from a list of items supplied by clicking the down arrow. Now lets take a closer look at the Field object and see what this property stuff is all about.
27 Field Properties The black arrow to the left of ProductName indicates the selected field. Since the Data Type is Text, the appropriate properties are displayed with some default values. The Field Size default is 50 but can be as high as 255. Now let’s take an in-depth look at each of the Field Properties for Text type.
28 Field Properties (Contd.) The Format property is used to customize the way numbers, dates, times, and text are displayed and printed. Input Mask is used to simplify data entry. Use the Caption property to provide helpful information for your user. Default Value is used to specify a string that is entered automatically for all records. It can be overridden. Validation Rule and Validation Text are used to define rules for data entry. More on this shortly. Required specifies whether data must be entered in this field.
29 Field Properties (Contd.) Allow Zero Length specifies whether users can enter an empty string as opposed to a Null value. See help for clarification. Index set to Yes forces an index to be created for this field. Unicode Compression allows data in a Text field to be compressed. IME Mode and IME Sentence Mode are relevant to the Japanese Kanji character set.
30 Data Validation As this screenshot shows, the Validation Rule property forces the user to enter a number greater than zero for the UnitPrice field. If they do not, the Validation Text property specifies the message displayed to the user. Validation Rule property is very flexible. We could have entered “greater than zero” instead.
31 Additional Properties The Required property specifies whether a value must be entered for a given field at the time a record is entered. Indexed property if set to Yes means that an index is created for every new record added. Indexes speed up searches and sorting.
32 What we have covered The Access Help system Access Database design strategies Understanding the available data types The importance of good Interface design The importance of user involvement in the design process Tips on Table design and data normalization Reducing data redundancy The Table Wizard Understanding Field properties