introduction to microsoft access 2007 minimal manual

University of Glasgow
Department of Computing Science
INTRODUCTION TO MICROSOFT ACCESS 2007
MINIMAL MANUAL
1
2
3
4
5
6
7
8
9
9.3
Parameter queries (NOT UPDATED 2007) ................................................ 13
9.3.1
Using the Access parameter query dialog form ................................... 13
9.3.2
Displaying a subset of records on a form or report , using a text or
combo box ............................................................................................................ 13
10
Reports (NOT UPDATED 2007)..................................................................... 14
11
Maintenance ..................................................................................................... 15
Databases in Access ............................................................................................... 3
Creating a Database ............................................................................................... 3
Help ........................................................................................................................ 3
Saving .................................................................................................................... 3
Tables ..................................................................................................................... 3
5.1
Datasheet view ............................................................................................... 3
5.2
Design View................................................................................................... 4
5.3
Properties ....................................................................................................... 4
5.4
Primary key .................................................................................................... 4
5.5
Creating tables ............................................................................................... 4
5.6
Altering a table............................................................................................... 4
5.7
Indexes ........................................................................................................... 5
Relationships .......................................................................................................... 5
6.1
Viewing / altering relationships ..................................................................... 5
6.2
Types of relationship...................................................................................... 5
6.3
Enforcing referential integrity........................................................................ 6
6.4
Deleting a relationship ................................................................................... 6
6.5
Creating relationships .................................................................................... 6
6.6
Printing relationships ..................................................................................... 7
FORMS : Data entry and update............................................................................ 7
7.1
Customised form ............................................................................................ 7
7.2
Forms can be open in 3 views: ....................................................................... 7
7.3
The underlying table or query ........................................................................ 7
7.4
Controls .......................................................................................................... 7
7.5
Properties ....................................................................................................... 7
7.6
Creating a form .............................................................................................. 8
7.6.1
Using a Wizard ...................................................................................... 8
7.6.2
Using Design View ................................................................................ 8
7.7
Subforms ........................................................................................................ 8
7.8
Navigation buttons ......................................................................................... 9
7.9
Inserting a picture .......................................................................................... 9
Forms : Navigation and finding data (NOT UPDATED 2007) ............................. 9
8.1
A switchboard ................................................................................................ 9
8.2
Dialog forms. ............................................................................................... 10
8.3
Navigation buttons ....................................................................................... 10
8.4
The Find command ...................................................................................... 10
8.5
Searching with a text or combo box ............................................................ 10
Queries ................................................................................................................. 10
9.1
Types of query ............................................................................................. 10
9.1.1
Select queries (These are called Views in database theory) ................ 10
9.1.2
Action queries ...................................................................................... 11
9.1.3
Access Views for queries ..................................................................... 11
9.2
Select queries ............................................................................................... 11
9.2.1
Design View : using a grid................................................................... 12
9.2.2
SQL View ............................................................................................ 12
AccMinMan
MF,RC,JEJ
26/10/09
Page 1 of 15
AccMinMan
MF,RC,JEJ
26/10/09
Page 2 of 15
5.2
1 Databases in Access
An Access database consists of the following
kinds of objects: tables, queries, forms,
reports, data access pages, macros and
modules. (Macros and modules are not
covered here.) To work with any of these
objects, use the drop down menu accessible using this button.
For each kind of object, there are usually several interfaces which support interaction.
These are called Views, which is unfortunate since the term View has a quite different
meaning in database theory i.e. a calculated table.
2 Creating a Database
To create a new database select New in the Office button and then
follow these steps:
a) Choose New Blank Database
b) Create tables (you start off doing this)
c) Create relationships
d) Create data entry forms
e) Create other queries and reports
3 Help
Select Help : Microsoft Office or press F1 or press the question mark
button (top right). You will be thrown into a pane into which you can ask the system
to search for help on a topic. There is also a table of contents accessible by selecting
the little purple book icon.
Look up the help whenever you want to more about a topic.
4 Saving
Access saves the database automatically when an object is created or deleted, and
when data is added or deleted. It does not save changes to objects automatically, so
you should save frequently if, for example, you are in the middle of creating a
complicated form, or writing Visual Basic code.
5 Tables
Tables are the heart of an Access database. They are made up of records and fields. A
record corresponds to a row of the table and contains information about a single entity
described by the table. The fields correspond to the columns of the table, and are the
basic unit of the database, storing a particular piece of data.
5.1
Datasheet view
Datasheet view displays the data in the table in
a spreadsheet-like grid.
Design View
Design view is used to create or alter the structure of
the table, for example adding fields, and specifying the
type of information stored in a field (e.g. numbers,
date, text).
For each field in the table, the field name, data type and
description are easy to see.
More details about each field – properties – are shown
in the box at the left hand bottom corner. Click on a
particular field to see its properties.
When you create a table, you are put into Design View so that you can add details
about the fields you want in the table.
5.3 Properties
Properties include
• Input mask : specifies format of data
• Caption : for user friendly text.
• Validation rule : specifies permitted values for the data
• Validation Text : message to be displayed if validation rule is not met
• Indexed : specifies whether field is indexed or not and whether duplicates are
allowed.
The Lookup tab specifies permitted values for a field where the values must be one of
a predefined list – either from a table which is naturally included in the database
design, or by introducing a special ‘lookup’ table. You can choose ‘Lookup wizard’
as the data type or click on the Lookup tab and enter the details yourself. Don’t use a
value list as it is a lot easier to modify values in a table.
5.4 Primary key
The primary key is the field or combination of fields that uniquely identifies each
row. To set the primary key, highlight the field(s) (hold down the CTRL key and drag
the mouse over the left hand edge of the fields in design view). Then click the key
button in the toolbar.
5.5 Creating tables
• New tables can be created by selecting Tables in the Create menu.
• Again this uses Design View.
• Field names should be readable, mixed case, don’t include spaces.
• Add field constraints such as input masks, validation rules, default value. If you
used the Table Wizard, check whether you really want the constraints that the
wizard inserted (e.g. input masks etc), and decide whether to add more of your
own.
• Choose your own primary key, unless you want to use autonumbering.
For any fields that refer to a lookup table, enter details for the type of control, row
source, and probably Limit to List.
5.6 Altering a table
Open the table in design view, and amend.
AccMinMan
MF,RC,JEJ
26/10/09
Page 3 of 15
AccMinMan
MF,RC,JEJ
26/10/09
Page 4 of 15
5.7 Indexes
The primary key of a table is automatically indexed. You can also create additional
indexes if required. You can't index a field whose data type is Memo, Hyperlink, or
OLE Object.
•
If the field name ends in 'ID', Access automatically
creates an index for this field, whether you want it to
or not. You should amend or delete the index if
necessary.
•
The last property listed is Indexed: Set this to show
whether an index is required or not, and if it is,
whether duplicates are permitted or not. This is
important since if you want to create a foreign key to a
field it must not allow duplicates.
You can see the indexes for a table from the
menu View:Indexes. This shows any indexes
that you have created, and the primary key
index.
•
A one-to-one relationship is created if both of the related fields are primary keys
or have unique indexes.
An indeterminate relationship is created when neither of the fields has a unique
index. You should be able to correct this by ensuring that at least one of the fields
is either a primary key or has a unique index.
There are no many to many relationships – these are modeled by an intersecting
table which has a one to many relationship with the two tables.
6.3 Enforcing referential integrity
You should enforce referential integrity - the values of a foreign key must correspond
to an existing value in the related table.
It may be appropriate to cascade updates or deletes. If you do not cascade, then you
will not be permitted to update or delete a value if there are any records with that
value in the related tables.
• Cascade update : if a value is altered in the table on the one side, it is
automatically updated in the related tables. (Good for spelling mistakes or
regrouping).
• Cascade delete : if a value is deleted from the table on the one side, then all
records with that value will be deleted from the related tables on the many side.
This is good for getting rid of dependent weak entities, for instance.
• Foreign keys not null. If a foreign key is also the primary key, it cannot be null.
Otherwise, if it cannot be null, set the field property ‘Required’ in the table
design.
6.4 Deleting a relationship
Single click on the relationship line, and press the DEL key.
6 Relationships
Relationships are the backbone of the ER model. The relationships between the tables
must be created in the Relationships window (Choose Database Tools :
Relationships).
The relationships are shown by the lines between the associated fields in the tables.
6.1 Viewing / altering relationships
Double click on the relationship line to see the relationships dialog box, which is used
to create or alter relationship details.
6.5 Creating relationships
• Click on the field in the table in the ‘one’ side and drag to the fields in the table on
the ‘many’ side. To drag multiple fields, press the CTRL key and click each field,
then drag them all.
• In most cases, you drag the primary key field (which is displayed in bold text)
from one table to a similar field (often with the same name) called the foreign key
in the other table.
• The related fields don't have to have the same names, but they must have the same
data type (with two exceptions) and contain the same kind of information. In
addition, when the matching fields are Number fields, they must have the same
FieldSize property setting. The two exceptions to matching data types are that
you can match an AutoNumber field with a Number field whose FieldSize
property is set to Long Integer; and you can match an AutoNumber field with a
Number field if both fields have their FieldSize property set to Replication ID.
• To create a recursive relationship (between a table and itself), add that table to the
relationship window twice. Access supplies a second icon for that table, and you
can then drag the field from the first icon to the related field on the second icon.
This does not mean that there is another copy of this table in the database, merely
that the designers of Access think that a second representation makes the diagram
clearer.
6.2 Types of relationship
Microsoft Access creates the relationship automatically, depending on how the
related fields are defined:
• A one-to-many relationship is created if only one of the related fields is a primary
key or has a unique index.
NB If you drag a field that isn't a primary key and doesn't have a unique index to
another field that isn't a primary key and doesn't have a unique index, an
indeterminate relationship is created. In queries containing tables with an
AccMinMan
AccMinMan
MF,RC,JEJ
26/10/09
Page 5 of 15
MF,RC,JEJ
26/10/09
Page 6 of 15
indeterminate relationship, Microsoft Access displays a default join line between the
tables, but referential integrity won't be enforced, and there's no guarantee that records
are unique in either table.
6.6 Printing relationships
In Access 2000, you can choose File:Print Relationships.
In Access 97, you will need to send the Relationships window to the clipboard (using
the Alt PrintScreen key) and paste into a document for printing.
7 FORMS : Data entry and update
7.1 Customised form
Viewing or entering the data in a table in datasheet view is very similar to looking at a
spreadsheet. It can be adequate, but rows may not fit completely into the window
width, and identification of foreign keys is unsatisfactory. You may also wish to
include some explanatory text. It is far better to enter and update data using a
customised form.
7.2 Forms can be open in 3 views:
Form View
displays the form and the active record(s)
Design View
you can create / alter the layout
Datasheet View presents the data from your form in a datasheet.
7.3 The underlying table or query
The form is bound to a table or query. Only fields in the underlying table or query
can be shown on the form. These fields are listed in the Field List : open from button
in toolbar.
7.4 Controls
• Fields are displayed in controls such as text boxes or combo boxes. Combo
boxes should be used if the field is based on a lookup table. Each control can be
bound to a particular field, or unbound (for calculated text).
• Other controls include command buttons, checkboxes, page breaks, lines and
boxes.
• Subforms are often used for 1 → many relationships
• The constraints (eg validation rules) which are defined in the table before the form
is created are inherited by the form. However, this is not the case for constraints
added to the table after the form has been created.
7.5 Properties
The form itself and all the controls on it have properties.
These can be seen in Design View by double-clicking on the particular control.
Double-click on the small square, top left corner of the form, to see Form properties.
Many properties are set automatically when the control is created. They can be
altered afterwards if required, sometimes graphically (e.g. size) or textually (e.g.
border style).
AccMinMan
MF,RC,JEJ
26/10/09
Page 7 of 15
7.6
Creating a form
7.6.1 Using a Wizard
The best way to create a form is often using the Form Wizard, then adapting the form.
There are several styles available:
Tabular
like a table, one line per record
Columnar
one record per form, one line per field
Justified
one record per form, tightly packed.
Datasheet
in datasheet format
If the wizard is used, the form will usually need modification - adjusting the size of
text boxes and labels, colours, the size of forms etc. Also check the properties for
various controls. Controls can be added using the Toolbox (below)
7.6.2 Using Design View
All the controls can be added to the form via the Toolbox (View : Toolbox or toolbar
Toolbox button).
• Add a bound control by dragging the field from the Field List (open by clicking
on Field List icon).
• Add an unbound control by clicking first on the toolbox icon and then clicking on
the form.
• In general each control has an associated label control (typically displaying the
name of the field it is bound to).
• Unattached labels are used for placing explanatory text on the forms.
• There is also a formatting toolbar which usually appears automatically to assist
with setting fonts & colours – if it’s not there, find it in the menu View : Toolbars.
• There are several useful menu commands in the Format menu eg Align, Size,
Spacing.
•
•
The style of the form can be changed using Format : AutoFormat
The tab order of the controls can be altered using the menu View : Tab Order
7.7 Subforms
Subforms are useful to show the ‘many’ (child) side of a ‘one-to-many’ relationship
in a form based on the ‘one’ (parent) side. For example, all the tracks of a particular
CD can be shown on a subform.
If the relationships between the tables have been set up correctly, a form with
subforms can be created successfully with the wizard :
• Choose Create form using wizard
• Include all the required fields from the parent table, then the required fields from
the child table.
• You want to view the data by the parent key and with subforms (the default)
• Choose a tabular or datasheet layout for the subform.
• Choose a suitable form style.
• View the form with data, adapt if required.
• Look at the linking child and master properties for the subform – in design view,
select subform and view properties. The ‘linking child and master field’ properties
should have been set correctly automatically because the relationships between the
tables were set up before the form was created. They control which tracks are
displayed on the form. Also, the value of the foreign key in the child table will be
set automatically, even though it is not explicitly typed in. It is therefore optional
to have the foreign key displayed on the subform, although when you are
developing the form it is comforting to see it there.
AccMinMan
MF,RC,JEJ
26/10/09
Page 8 of 15
7.8
Navigation buttons
8.2 Dialog forms.
Alternatively you can make your own dialog forms. These are not bound to a
particular table or query, and contain command buttons giving several options.
The Form DemoForm in MyCDs is an example.
These are at the bottom left hand corner of the form.
Sometimes you may prefer to make your own navigation buttons elsewhere on the
form, particularly if you have the bottom left hand corners of a subform and the main
form next to each other, which can be confusing. This can easily be done using the
command button wizard from the Toolbox.
• Double click on the square, top left corner of form, to see the Form properties.
• Set Scroll bars to Neither, navigation buttons to No.
• Move existing controls on the form to make space for the new buttons.
• Add a button to the form – make sure the Wizard button on the toolbar in ON.
Click on the command button in the toolbox, click on the form. Follow the Wizard
instructions to choose Record Navigation : Go To Next Record. Choose a picture
or text. Call the button something more meaningful than Command16 e.g.
cmdNextRec. However, there is a bug in Access2000 such that deleting a button
does not remove the support code. This means that every time you create a button
you must give it a new and different name, even if you are replacing an old one.
7.9 Inserting a picture
• Pictures can be stored with the OLE datatype.
• Pictures cannot be seen or stored in datasheet view – a form is needed.
• Store a picture by right mouse clicking on the destination control in the form, then
choosing Insert Object and navigating to the file containing the picture.
• Objects can be either linked (the picture is not stored in the database, so any
changes to the picture are shown in the database too) or embedded (the picture is
stored in the database).
•
Create a new form using the Design view, double click on the small square, top
left corner between the rulers, to see the properties. Set Border to Dialog, Scroll
bars, navigation buttons and record selectors to No.
• To create the command buttons click on the command button icon on the Toolbox,
then click on the form.
Follow the wizard instructions.
8.3 Navigation buttons
The navigation buttons can be used to tab through the records one by one.
8.4 The Find command
There is a Find command which can be used with any field to search for an exact
match.
• In Form View, click on the text box of the field you want to search for.
• Click on binoculars in the toolbar, or choose the menu Edit : Find
• Type in the value in the dialog box, click on FindFirst
• The first record meeting these criteria is displayed.
8.5 Searching with a text or combo box
A text box or combo box can be placed on the form, listing all the possible values of
the field to be searched for. When a value is selected, the record with that value is
automatically displayed on the form.
A wizard can be used, although the ordering usually needs putting in manually.
•
8 Forms : Navigation and finding data (NOT UPDATED for 2007)
8.1 A switchboard
For a finished application, the user should not see the database window at all but
navigate through the application with forms. The switchboard is a special form for
navigation. It can be created and edited using the menu : Tools : Database Utilities :
Switchboard Manager.
• Give the switchboard a name
• Create new switchboard items by editing the switchboard page and clicking New.
A list of possible actions are provided : e.g. Open Form, Open Report. It is not
possible to run a query directly from the switchboard, you need to base a form or a
report on the query and open that.
• When the switchboard contains all the items required, close the dialog.
• A form (Switchboard) and a table (Switchboard Items) have now been created for
this switchboard.
• Set the switchboard to be opened when the database is opened by using the menu
Tools : StartUp and entering the switchboard name as the Display Form.
MF,RC,JEJ
•
More examples of finding data with combo boxes are in section 10.3
9 Queries
9.1
Types of query
9.1.1 Select queries (These are called Views in database theory)
Select
Find and display data according to supplied criteria
Parameter
As Select queries, but user is prompted for the criteria to use
An example is provided in MyCDs.
AccMinMan
•
For the combo box, make sure Wizard button is ON in the toolbox. Using the
wizard on a columnar form, create a combo box in the form header to ‘find a
record on the form based on the value selected in the combo box. The fields
shown in the combo box should contain the primary key and other fields that can
be used to usefully identify the record required. Often the primary key itself is
hidden. NB The wizard only works for selecting primary or candidate key fields
from a table – otherwise the combo box must be based on a query which selects
just the relevant field(s). E.g. SELECT Name FROM Styles;
Alter the combo box to display the values in order – in the combo box properties,
enlarge the window so that you can see all (and more) of the row source. Alter this
line : add ORDER BY fieldname at the end.
Use the combo box in Form view to change from record to record.
26/10/09
Page 9 of 15
AccMinMan
MF,RC,JEJ
26/10/09
Page 10 of 15
Crosstab
Duplicates
Unmatched
Displays summarized values (sums, counts, and averages)
from one field in a table and groups them by one set of values
listed down the left side of the datasheet and another set of
values listed across the top of the datasheet
Wizard used to find records in table that have same values in
one or more fields
Wizard used to find records in one table with no
corresponding records in another table.
9.1.2 Action queries
Delete
Finds records and deletes them
Update
Finds records and changes one or more of their values
Append
Takes records from one or more tables and appends to the end
of another table.
Make-Table
Selects a set of records and stores them in a new table
9.1.3 Access Views for queries
Queries can be looked at in three ways (To change use the View drop down in the
Home menu):
Design View
Grid for creating queries graphically.
This generates SQL automatically,
which can be seen in SQL view
Good for simple queries, useless for
complex subqueries, can’t always
see complete query
SQL View
Window for typing in or
viewing SQL
9.2.1 Design View : using a grid
• Add the tables required to the top of the grid (Query : ShowTable) , and the fields
•
•
•
•
•
•
•
•
required (by double-clicking on them) to the bottom half of the grid.
As long as the relationships have been set up properly before the query is created,
Access will handle the relationships between the tables for you (shown by a line
between the related fields)
To sort, select either Ascending or Descending. Multiple sorts are left to right.
To move the position of fields in the query grid, select the field column and drag.
To delete fields from the query grid, select and delete.
To calculate aggregated fields ( sum, average, minimum, maximum) choose
Totals (View : Totals from menu, total button from Toolbar). An extra row appears in
the query grid : fields must either be an aggregate function or have GroupBy set.
Run the query with the toolbar Run button (!) or the menu Query : Run
Queries can be saved and then appear display in the database window in the
Queries section.
You can see the equivalent SQL by looking at the SQL view of the query. Choose
the menu View : SQL or the toolbar SQL button.
9.2.2 SQL View
You can use this window to enter SQL directly or to view the SQL generated by
Access. For new queries, choose design view, close Show table dialog box, change to
SQL View.
Joins
Datasheet View (Select queries only)
Displays the results of the query.
The data displayed here is the
result of running the query at
this time.
SQL generated by Access joins tables using the terminology
FROM table1 INNER JOIN table2 ON table1.field1 = table2.field2
compared with the standard SQL
FROM table1, table2 WHERE table1.field1 = table2.field2
9.2 Select queries
Queries are used to view a required subset of data from the database.
e.g. All CDs bought after 1/1/99, all CDs with a track by Elvis Costello.
They can be defined by filling in a special grid, or by typing in SQL directly.
AccMinMan
MF,RC,JEJ
26/10/09
Page 11 of 15
The advantage of using the grid is that all the joins are made for you automatically,
and the ‘WHERE’ section of the SQL is reserved for selection criteria. However when
more than about three tables are joined, the joining part of the generated SQL gets
very difficult to read or modify.
Access can also do simple LEFT or RIGHT joins (where the data is always selected
from the main table, regardless of whether data occurs or not in the other tables). See
the Help for more details.
AccMinMan
MF,RC,JEJ
26/10/09
Page 12 of 15
a. Create a new form using the Design view, double click on the small
square, top left corner between the rulers, to see the properties. Set Border
to Dialog, Scroll bars, navigation buttons and record selectors to No.
b. Add a text or combo box to the form. (See section 9.5). The combo box
should contain the possible parameter values.
Other Access specific details in SQL
• Use SQL aggregate functions (e.g. Sum, Count, Avg,…)
• Fields are renamed using AS
SELECT SUM(CD.Price) AS TotalPrice
•
You can use various Access SQL operators
WHERE Name Like (Red*”)
WHERE CatNum Between 5 and 10
WHERE COUNTRY Not “Scotland”
WHERE Title Is Null
SELECT Price*Quantity AS TotalPrice
•
There are many Access functions
WHERE Year([DateOfBirth]) = Year(Date())
SELECT Left(Firstname,1) & Left(Lastname,1) AS Initials
9.3 Parameter queries (NOT UPDATED for 2007)
The criteria are determined at runtime.
There are two ways of using parameters: either using the Access parameter dialog
form, which is simple to use but not very user friendly, or using a customised form for
parmeter input.
2. Make a parameterised query which contains the fields required on the report. For
the field which depends on the value on the dialog form, type a prompt within
square brackets in the ‘criteria’ box of the grid, or on the RHS of a WHERE
condition. (see next page for example)
E.g. [Forms!X!Y] in criteria grid
Or WHERE Style = [Forms!X!Y] in SQL
where X = name of dialog form and Y = name of combo box. Remember that you
can look in the properties of any control to see its name. Test run this query with
the dialog form open and a value selected in the combo box.
3. Create a form or report based on this query. Test with dialog form open.
4. Add a command button to the dialog form which opens the form or report.
9.3.1 Using the Access parameter query dialog form
10 Reports (NOT UPDATED for 2007)
To open a form or report based on the value selected in a combo box:
1. Make a dialog form containing an unbound text box or a combo box based on all
possible parameter values
Reports can be defined to display and print formatted, grouped and aggregated data.
They are a specialised kind of form where there is no data entry. The controls are
similar to a form too.
Reports can be opened in
Design View
for creating or altering the layout of your report
Print Preview
displays the report ready for printing
Layout View
displays what the layout will look like – but the data is not
always correct. This can be worrying!
• There are wizards, similar to Form Wizards. A report will probably need adapting
when it has been made with the wizard. Consider the size, colour, location of
controls, also the text in labels and headings. A border is sometimes drawn which
can be changed to be transparent. Lines across the page are often useful. The
underlying format of a report can be changed using Format:AutoFormat. It’s not so
easy to change the style.
• All reports are based on a table or query.
• Reports are divided into sections. There are 3 headers (Report, Page, Group), a
Details section and 3 footers (Group, Page, Report).
• The detail section is triggered by every record, so to get a summary report you
make the detail section empty.
• Multiple groups are allowed and the sections are nested.
• Calculated text boxes can be included in report.
• Group summaries like totals are included by defining a calculated text box with an
expression containing a summarising function. Alternatively the summary can be
an aggregate function produced as part of the query that the report is based on.
These controls should be located in the group or report footer. NOT Page footer.
• Use Sorting and Grouping button to determine whether any group headers /
footers, keep all group together on page. Footers may just be white space.
• Grid property can be increased from 10 to 20 for easy positioning.
• Report query might not need Order property because this can be done in
Sorting/grouping control
AccMinMan
AccMinMan
•
•
•
Make a new query using the grid or SQL
For the field which needs a parameter value, type a prompt within square brackets
in the ‘criteria’ box of the grid, or on the RHS of a WHERE condition.
E.g. [Enter style] in criteria grid
WHERE Style = [Enter style] in SQL
Or
A parameter dialog box appears with this prompt when the query is run.
You will also see this dialog form if there are any unrecognised field names in your
SQL. They will be interpreted as a parameter.
9.3.2 Displaying a subset of records on a form or report , using a text or
combo box
It is possible to use the wizards to create the combo box displaying possible values,
and the button which opens a form displaying only those records matching the criteria
in the combo box. However, sometimes the wizard is too clever, especially if the
combo box is based on a non-key field, and creates something that is not required at
all. Also, the wizard does not enable reports to be opened this way, so the following
approach is recommended
MF,RC,JEJ
26/10/09
Page 13 of 15
MF,RC,JEJ
26/10/09
Page 14 of 15
•
The report wizards are quite good and allow you to choose how to group your
records. As with forms, the controls will need adjusting for a satisfactory
appearance.
11 Maintenance
The size of the database grows a lot under development. Reclaim unused space
• every time by setting Tools : Options : General : Compact on close
• or periodically using Tools : Database Utilities :Compact database
AccMinMan
MF,RC,JEJ
26/10/09
Page 15 of 15