Inserting a table grid into a form: example

You have two tables in a database, one called Employees which contains employee names and ID numbers, and another called Holidays, which contains employee ID numbers and information on holidays yet to be taken by each employee by the end of the year, excluding the general Christmas holiday.

The aim is to display a table in forms for each of the records in the attached table.

Employees

ID

Surname

First_name

1

SMITH

JACKIE

2

ROACH

PHILIPPA

3

ENGLAND

CHRIS

4

COLEMAN

JOEL

5

SMITH

JAMES

6

HOWLETT

PAULINE

 

Holidays

ID

Holidays

Days

6

November 2 - 5

4

5

October 2 - 15

10

4

October 3 - 7

5

6

December 1 - 5

5

1

October 21 - 23

3

4

December 2 - 4

3

5

November 18 - 22

5

Assuming you have already created a form that is attached to the Employees table and that you are in form design mode, follow these steps:

  1. Select Table Grid from the Insert menu.

  2. Position the cross at the place you want in the form, depress the left mouse button and release.

  3. In "Insert Field Wizard" make the following selections:

  1. Move the ID and Days fields from Hidden columns to Visible columns, using the Show button.

  2. Click on Finish to insert the field.

  3. Click on the Browse button image\browsemd.gif to switch from design mode to browse mode.

Use the Record buttons to move through the forms. Since each record in the attached table has a corresponding form view, there will also be a corresponding table in each form. The table will have fields for ID and Days.

The first form will show a table with ID number 1 and Days 3; the second form (for ID 2, that is Philippa Roach) will show a blank table (there is no ID 2 in the Holidays table); the sixth form will show a table with two records (ID 6, that is Pauline Howlett, has two holiday periods of 5 and 4 days respectively); and so on for the other forms.