Selecting records manually

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello, I've got following problem.
I have a datalist (sub)form, which I populate with records. Then I want user
to select some of them and print selected (in report).
I would like to add checkbox on the begginning of each line to allow user to
select which records he wants to see in a report.

Problem is how to do it? how to add checkbox to each record? I don't have a
DB field to store the value, therefore checkbox is unbounded and ONLY ONE
(not one for each record-it's on each row, but if I check one, all of them
gets checked). And how to access it to find which records are selected?

I hope u understand...

Thanks in advance

Lukas
 
You need to add a field to do this. You would then open the report using a
filter on that field. Have the report clear all checkmarks when it closes if
you want by using an update query in the report's Close event. The extra
field in the table won't hurt anything, you just ignore it for items where
you don't want to use it.
 
Ok, create a temporary table. You will need two fields in the temporary
table. The first will be linked to the ID field of the main table, the other
will be a Yes/No field. Add this table to the query supplying this form. The
table will be located in the front end, which each user should have their
own copy of. In the link in the query between the two tables, set the link
to show all records from the main table and only those from the temp table
where the values match. As you check each check box, add it to the temp
table (True and ID value). You can then use this linked table to control
which records get printed by using another query with a standard link
between the tables for the report. This will limit the returned values to
those that exist in both tables. Clear the selections by using a delete
query to clear the temp table. This can be done with the click of a button,
when you close the form, or when you close the report.

The linked fields will control what is printed, the yes/no field will give
you something to check and since it is a bound control, it will show up
properly on a continuous form.
 
PS.

Actually, in testing this I didn't have to "add" these records to the temp
table. Just checking the checkbox did it. If you don't want to use the
second query, you could filter the report on the True value of the yes/no
field. This would also make it easy to show all records in the report by
just not filtering.
 
Back
Top