Ian said:
Any help appreciated-
I want to select some records in a table, and then print them. The
records are noncontiguous (not next to each other), is there a way to
select them? Thanks
There are several ways, but unfortunately none of them is as simple as
we might like. Probably the simplest -- if you are allowed to modify
the design of the table, and if only one person is likely to be
selecting records at any given time -- is to add a Yes/No field
"IsSelected" to the table. Then on a continuous or datasheet form, you
can have a check box bound to this field and just go along checking the
boxes for the records you want to print. Then you open your report with
a where-condition that selects only those records where IsSelected =
True.
Naturally, you'll want a command button to "deselect" all records by
running an update query to set the IsSelected field = False for all
records, and you may want a "Select All" button to set it to True for
all records.
If you can't modify the table to add such a field, you can create a
table to hold just the primary key of each selected item, with code on a
form to add or remove records from this table. Then you join this table
to the main table to get just the selected records for printing.
Yet another alternative, if there aren't very many records, is to use a
multi-select list box to present a list of records to be selected, and
then build a criteria-string for your report from the selected items in
the list box.