course form in the main window (cf. figure 2), click on forms, then double-click on create form by...

23
Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below. Creating Forms

Upload: yolanda-blagg

Post on 28-Mar-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Course Form

In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard.

Follow the sequence of actions below.

Creating Forms

Page 2: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

In Figure 12, choose the table that you want to create a form for, in our case Course, then choose all the fields so that they are “moved” from the Available Fields to Selected Fields. In the figure, this is already done. Press Next.

In the second wizard window, choose a layout form (Columnar is our choice). Press Next.

In the third wizard window, choose a style (Standard is our choice). Press Next.

In the fourth wizard window, choose a name for this form (Course is fine), and keep the option ‘Open the form to view or enter data’. Press Finish.

Course Form

Page 3: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Course Form

Page 4: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

A window as in Figure 13 appears. It contains data from our Course table.

You can browse through the entries with the buttons on the bottom part of the window.

Note that the shown labels contain the strings that we chose in the Caption field when the created the table.

We can now adjust the layout of the form by entering the form in design view, e.g. by pressing the left-most button on the tool bar.

Course Form

Page 5: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Course Form

Page 6: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Adjust the length of fields by dragging their borders to an appropriate size.

Prevent users from editing the primary key by (a) right-clicking in the CourseID field and choosing Properties from the popup menu or (b) by double-clicking on the CourseID field.

Properties are your way of managing forms. Get used to the ugly display of information and the sparse information. This is the place where you do all the important changes to a form.

Disable the CourseID field by setting the property Enable (in tab All or Data) to No.

Close the Properties-window, save the form and open it in form view. It now looks like Figure 15.

Course Form

Page 7: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Course Form

Page 8: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

How to get rid of displayed keys in the form.

Open the Course form in design view and double click on the field (not the label) CourseInstID. This opens the Property window for the combo box CourseInstID. And now comes the cryptic part which would take ages to find in the documentation!

Instead of basing the contents of this combo box on a query that returns only the institution id, we base it on a query that also returns the institution abbreviation. Switch to tab Data. Put the cursor in the field Row Source (where some SQL is

displayed) and click on the …-Button that appears to the right of the field. That opens a query editor as shown in Figure 16.

Page 9: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

How to get rid of displayed keys in the form

Page 10: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

How to get rid of displayed keys in the form

Drag the text InstAbbr from the upper part of the window to the empty column on the lower part of the window so that it appears next to InstID.

Page 11: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

How to get rid of displayed keys in the form

Close the query builder and save the query. You are now back in the Properties window for CourseInstID.

In tab Data, make sure that Bound Column contains a 1 (digit one) if InstID is the first column returned from your query.

Switch to tab Format. Change the value for Column Count from 1 to 2 (our query

returns now two columns not one). Change the value for Column Widths from something like

2.54cm to 0cm;3cm (meaning that you do not at all want to display the first column (0cm) but the second column with a width of 3cm). This was straightforward, right?

Close the Properties-window. Change the label of CourseInstID to e.g. Responsible

Institution. Save the form and display it in form view (cf. Figure

18).

Page 12: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

How to get rid of displayed keys in the form

Page 13: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Student Form with Course Information

In the first wizard window, we choose fields from the following tables Student: All fields Participate: PartCourseID, PartYear Course: CourseName, CourseLevel Institution: InstAbbr, InstName

In the second wizard window, choose to see data by student and form with subforms.

In the third wizard window, choose Tabular layout. In the fourth wizard window, choose Standard style. In the fifth window, accept the suggested names

Student and Participate Subform and finish. The following first look of our form is shown.

Page 14: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Student Form with Course Information

Page 15: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Student Form with Course Information

Now edit the form in design view: Disable the StudentID-field. Adjust the length of some fields and labels if

necessary. Do not display the PartCourseID but the course

abbreviation. Open the properties of the field PartCourseID. Change the query to include not only Course.CourseID but also

Course.CourseAbbr. Follow the subsequent steps from above (How to get rid of

displayed keys in the form) by checking and—if necessary—editing the properties Bound Column (new value: probably 1), Column Count (new value: 2), Column Widths (new value e.g.: 0cm;3cm).

Save the form and display it in form view (cf. Figure 20)

Page 16: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Student Form with Course Information

Page 17: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Adding a button for editing course information

From the form that we created above, we also want to add new courses.

We add a button to the Student-form that opens our previously created form Course from this Student-form window.

Open the Student-form in design view. If not already open, open the floating window Toolbox

from the menu View Toolbox. Choose a Command Button from the toolbox (the tool

tips over the icons will tell you which is the command button).

Draw the button on the form. Automatically, the command button wizard will open and

help you configure the button.

Page 18: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Adding a button for editing course information

In Categories, choose Form Operations. In Actions, choose Open Form. Click Next and identify the form (i.e. Course) that you

want to open. Choose ‘Open the form and display all records’. Click

Next. Choose an appropriate name or symbol for the button on

the form. Click Next. Choose a name for the button widget. Click Finish. Save the form, open it in form view and check that the

button works by opening the course form and adding a new course.

Page 19: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Adding a button for editing course information

If you now try to assign students to the new course, you will note that the new course is not available in the Participate-subform! You must refresh the Student form before this is possible.

Page 20: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Simple Report

In the Access main window, choose Reports. Click on Create report by using wizard. In the first wizard window, you have to choose which

columns from which tables you want to display on your report (just as on a form). Choose the following columns: From table Course: CourseAbbr, CourseName From table Participate: PartYear, From table Student: StudentLastName, StudentFirstName

Click Next. View data by Course. Click Next. Choose a second grouping level on the year the students

to the course. Choose PartYear as an additional grouping level.

Page 21: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Simple Report

Press on the > button to update the report preview on the right-hand side of the window (cf. Figure 21).

Page 22: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Simple Report

Click Next. Order the students by last and first name. Click Next. Choose e.g. a Stepped lay out. Click Next. Choose e.g. Formal style. Click Next. Set or accept the name for the report, e.g. CourseReport.

Click Finish. A report as in Figure 22 displays:

Page 23: Course Form In the main window (cf. Figure 2), click on Forms, then double-click on Create form by using wizard. Follow the sequence of actions below

Simple Report

You can now choose to open the report to make changes to the layout, e.g. choosing a different font or size for some fields, adjusting the lengths of fields, etc. The handling of a report layout is similar to the handling of format layouts.