Create an Access report which replicates your form and base this on a query
which includes the table in which the data for the form is stored and a new
table, DepartmentList say, with columns DepartmentNumber and Department, so
it would look like this:
1 Accounts
2 Sales
3 Purchase and Supply
The query on which the report is based will include both tables, but not
joined. This gives what is known as the Cartesian product of the two tables,
which means each row in one is joined to each row in the other (in
mathematics a Cartesian coordinate is each of a set of coordinates describing
the position of a point in relation to a set of intersecting straight axes),
so you end up with three of each row from the main table (or another query)
in the query's result table. Add whatever columns you need for the report
to the query, plus the DepartmentNumber and Department columns from the
DepartmentList table.
Sort the report firstly on the DepartmentNumber column and then on whatever
is the primary key of the main table. Add a text box to the report, either
in the page header, detail or page footer section bound to the Department
column. Set the detail section's Force New Page property to 'After Section'.
If the report is opened unfiltered you'd get three copies of each record
from the main table on separate pages, with a different department name on
each. But you'll presumably want to filter it to a particular record from
the main table. You can easily do this from a button on a form bound to your
main table (or query) in which the data is entered. The Click event
procedure for the button would have code along these lines, assuming for this
example that the primary key column of the main table is a number column
called MyID:
Dim strCriteria as String
' first ensure current record is saved
Me.Dirty = False
' print report filtered to form's current record
strCriteria = "[MyID] = " & Me.[MyID]
DoCmd.OpenReport "MyReport", WhereCondition:=strCriteria
Ken Sheridan
Stafford, England