+ All Categories
Home > Documents > Assignment - ACCESS

Assignment - ACCESS

Date post: 15-Jan-2016
Category:
Upload: teyha
View: 13 times
Download: 0 times
Share this document with a friend
Description:
Assignment - ACCESS
Popular Tags:
21
ASSIGENMENT : ACCESS QUESTIONS You are requied to answer all question and answers and must be in accordance with the step-by-pictorial. 1.How to create a Table. 1. Creating a New Table by Typing It might seem strange to want to enter data into a table without first defining the table’s structure, but there’s one scenario where it makes perfect sense: when you’re in a hurry and you have to get the data into the database quickly.You can open the table in Design view and name the fields, define data types, and so on. 1.1. Create a New Table by Typing 1. Click the Create tab. 2. In the Tables group, click Table. 3. Type the data for the first new field and press Tab. 4. Repeat step 3 until you have typed all the data for one record, and then press Enter twice to return to the first field. 5. Click Save. 6.Type a name for your table. 7.Click OK.
Transcript
Page 1: Assignment - ACCESS

ASSIGENMENT : ACCESSQUESTIONSYou are requied to answer all question and answers and must be in accordance with the step-by-pictorial.

1.How to create a Table.1. Creating a New Table by Typing

It might seem strange to want to enter data into a table without first defining the table’s structure, but there’s one scenario where it makes perfect sense: when you’re in a hurry and you have to get the data into the database quickly.You can open the table in Design view and name the fields, define data types, and so on.

1.1. Create a New Table by Typing

1. Click the Create tab.2. In the Tables group, click Table.3. Type the data for the first new field and press Tab.4. Repeat step 3 until you have typed all the data for one record, and then press Enter twice to return to the

first field.5. Click Save.

6.Type a name for your table. 7.Click OK.

Page 2: Assignment - ACCESS

8. Click the Close box for the table.

2. Creating a New Table Using a Template

You can select from more built-in field types, or insert a set of multiple related fields by clicking the More Fields button and clicking the desired option from the menu that appears.

2.1. Add Fields from the Add & Delete Ribbon Group

1. Open a table in Datasheet view.2. In the table, click a cell in the Click to Add column.3. Click the Fields contextual tab.4. Click the type of field you want to add.

Page 3: Assignment - ACCESS

2.2. Add More Types of Fields

1. Open a table in Datasheet view.2. In the table, click a cell in the Click to Add column.3. Click the Fields contextual tab.4. Click More Fields.5. Click the type of field you want to add.

Page 4: Assignment - ACCESS

2.3. Add Multiple Related Fields at One Time

1. Open a table in Datasheet view.2. In the table, click a cell in the Click to Add column.3. Click the Fields contextual tab.4. Click More Fields.5. In the Quick Start section of the list, click the set of fields you want to add.

Page 5: Assignment - ACCESS

2. How to create a Query . Tables or Queries in Query Design View

To open tables or queries in Query Design view:

1. Activate the Create tab.

2. Click the Query Design button in the Other group. The Show Table dialog box appears.

3. Activate the Tables tab if you want to base your query on tables, activate the Queries tab if you want base your query on queries or activate the Both tab if you want to base your query on both tables and queries.

4. Click to choose the table or query on which you want to base your query.

5. Click Add. The table appears in the window.

a. Click to choose the next table or query on which you want to base your query.

b. Continue clicking tables or queries until you have all the tables and queries you plan to use.

6. Click Close. Access changes to Query Design view. records and all fields:

7.

Page 6: Assignment - ACCESS

8. Open a table or query in Query Design view.

9. Click the down-arrow in the first field on the Field row and then select the tablename.* option. The table name appears on the table line.

10. Click the Run button. Access retrieves all of the fields and records for the table and displays them in Datasheet view.

11.

12. Clik ok.

13. Change from Datasheet View to Query Design View

14. After you run a query, you can easily change back to Query Design view and make modifications to your query or create a new query.

15. To change to Query Design view:

Page 7: Assignment - ACCESS

16.

17. Activate the Home tab.

18. Click the down-arrow below View in the Views group. A menu appears.

19. Click Design View. Access changes to Query Design view. You can modify your query.

Save a QueryAfter you create a query, you can save it. You can rerun a saved query at any time. If you change the data on which the saved query is based, you will see the changes when you rerun the query.

Page 8: Assignment - ACCESS

1. Open the table or query on which you want to base your new table on in Query Design view.

2. Enter the criteria on which you want to base your new table.

3. Click the Make Table button. The Make Table dialog box appears.

Page 9: Assignment - ACCESS

4. Type the name you want to give your new table.

5. Click OK.

6. Click Run. You see the following prompt.

7. Click Yes.

8. Close the query. (Right-click the query’s tab and then click Close.)

9. Double-click the new table’s name in the Navigation pane to view the new table.

3.How to create a Form.1. Display Tabbed DocumentsMicrosoft Access 2007 offers an option to use a new .Each object is a separate tab so users can easily see the available objects and click on the one they want:

This option is set from the Access Options, Current Database:

Page 10: Assignment - ACCESS

Support Resizable Forms

Datasheets Should Have Alternating Row Color

To make rows easier to identify, you can specify a different color for every other row.

This option is available globally from Access Options under Datasheet, Alternate Background Color. Or you can set

it for a specific datasheet from the Home, Font section when viewing it:

Page 11: Assignment - ACCESS

Reduce the Size of Graphics on Your Forms and Reports

Enhance Command Buttons

Page 12: Assignment - ACCESS

Support Hyperlink Hand over Command Buttons

Set this Cursor On Hover property for command buttons so a hand rather than the traditional Windows

arrow appears over the command button.

Add Graphics to Command Buttons

Add graphics to Command Buttons with Text. Before you could have graphics or text, but not both. (If you

need this feature for pre-Access 2007 deployments, use this feature in our Total Access Components).

Use Transparent Buttons for a more Modern Look

Command buttons can have transparent borders so they look flat and more like Internet Explorer type

buttons.

Use System Colors for Office Themes

"Background Form" for the detail section

"Background Light Header" for headers and footers

"Dark Text" for labels

"System Button Text" for command buttons

Page 13: Assignment - ACCESS

4. How to create a Reports1. Open Report Wizard

Begin by selecting the CREATE TAB on the Access Ribbon. Then click REPORT WIZARD from the REPORTS group to open the pop up window.

2. Select Report Data Source and Fields

The first page of the Report Wizard is almost identical to that of the Form Wizard. On this page we will select QUERY1 as the DATA SOURCE for the Report. This is done by selecting the query from the list in the TABLES/QUERIES combo box. Then select all fields from QUERY1 by clicking the double arrow to the right of the text box labelled AVAILABLE FIELDS. The field names will now appear in the SELECTED FIELDS text box on the right. Click next to go to the second page of the wizard.

Page 14: Assignment - ACCESS

3. Report Grouping Levels

Page two of the wizard is where you can add grouping levels if required. So we could, for example, group each person in our report with others of the same age. We dont need to do this for this particular example, but it is certainly a useful feature that we might want to learn more about later. But for now, just click next.

4. Record Sort Order

Page three of the wizard is where you determine what order the records are displayed in your report. So for example you might want to display records in ascending order of age. For this example, however, we are going to put your records into alphabetical order for SURNAME and FIRSTNAME. Begin by clicking the top drop down box and selecting SURNAME, and in the box 2 below select FIRSTNAME. This means that records are sorted alphabetically by surname, and if two surnames are the same, the FIRSTNAME is used to determine which record comes first etc.

Click Next

5. Report Lay Out

This page of the Wizard is where you set the lay out for your report. There are various lay out options, but in our case we shall keep to the default setting of TABULAR.

Click next.

Page 15: Assignment - ACCESS

6. Style

For style, select Access 2007 from the list and click next.

7. Name of Report

Name your report REPORT1 and then click FINISH.

Your access report will now be displayed on the screen, and should look something like this:

Page 16: Assignment - ACCESS

5. How to create a Relationships

1. he first step is to create a new Access Database. Lets call it Customer Orders.

2. Next create a new table called tblCustomers with the following fields - ID (autonumber, primary field), FIRSTNAME (text), SURNAME (text), ADDRESS1 (text), CITY (text), and POSTCODE (text).

3. Create a new table called tblOrders with the following fields - ORDERID (autonumber, primary field), ITEMORDERED (text), DATE (date), PRICE (number, set the format property to currency), CUSTOMERID (number). CustomerId is going to be the foreign field when we create the relationship.

4. To create the relationship, select the DATABASE TOOLS RIBON and click the RELATIONSHIPS icon (from the SHOW/HIDE group).

5. This opens the RELATIONSHIPS window. You will also see the pop up SHOW TABLE form the first time you open the window. We are now going to select which tables are going to be used in the relationship.

Page 17: Assignment - ACCESS

6. There are just two tables in our example database. Click on tblCustomer to highlight it in blue if it is not highlighted already. Then click add. Do the same for tblOrder, then close the pop up SHOW TABLE form.You should now see the two tables represented as separate box's in the RELATIONSHIPS window. You will notice in the diagram below that each box has it's fields listed and primary keys indicated.

7. We will now click the ID field in tblCustomer and drag it to the CUSTOMERID field in tblOrder. Notice the mouse pointer image changes from a circle with a line across to a plus sign as it hovers over the fields in tblOrder. When you release the mouse button at the end of the click and drag operation, a new EDIT RELATIONSHIPS pop up form opens.

Page 18: Assignment - ACCESS

8. Click the three tick boxes which say ENFORCE REFERENTIAL INTEGRITY, CASCADE UPDATE RELATED FIELDS, and CASCADE DELETE RELATED RECORDS. We won't be going into what these do in this blog post.

9. Click the CREATE BUTTON. Our table relationship is now in place. This is what the database window looks like now. Note the line drawn by Access between the ID field of tblCustomer and the CUSTOMERID field of tblOrder.

All we need to do now is enter some data and test out the relationship. Try entering this data from the image below into tblCustomer:

Page 19: Assignment - ACCESS

Then enter this data from the image below into tblOrder:

Notice that each order in tblOrder has a CustomerId corresponding to one of the customer ID's in tblCustomer. This is how we link each order to a particular customer. To prove that this works, open up the tblCustomer table and click the + sign's (left of table) on each customers row. This shows that Access has automatically linked each order from tblOrder to it's corresponding customer in tblCustomer.

Page 20: Assignment - ACCESS

All this gives us a basic idea of what table relationships are all about. There is, however, much more to it than this. For example, once we have set up relationships like this, we may create forms, queries and reports that reflect these relationships, and exploit the advantages that this has over single table "flat file" database applications. In the next blog post, I hope to write about creating a single Access Form which allows us to enter data into both Customer and Orders tables together.


Recommended