Selecting items in Access

  • Thread starter Thread starter Mondou
  • Start date Start date
M

Mondou

I have an access database with serves as a catalog with the picture of
each catalogued item.

I have a form that enables me to view each item along with it's
information (Item number, description, picture and price). On that
form, I have placed a button which enables me to view that same info as
a report to print.

I would like to be able to select several items in my form that could
be grouped together and viewed as a report ( about 6 items per page).

Basically, I would go through each record in my form, select the
records that interest me, and be able to generate a report with all of
these records together.

I thought of using a check box on each record of my form but can't
figure out how it works.

How do these check boxes work ? ...Does anyone have any suggestions ?
 
Try this.

Add a so-called "Boolean" or yes/no field to your table. Then add a
checkbox to your form. Set the ControlSource propery of the checkbox,
to the name of the boolean field in the table. This connects that
checkbox, to that field.

Now create a /report/ (not another form) whose RecordSource property is
set to:

SELECT * FROM [table name] WHERE [boolean field name] = True

Use the actual name of your table & boolean field in the statement
above. Drag fields from the field list, on to the report.

Now, when you move from record to record on the form, you can click the
checkbox to "select" that record. Then, when you run the report, it
will only process the currently selected (ticked) records. You could
have a button on the form to view /or just print/ the report - see
DoCmd.OpenReport.

See if you can get that working & whether it does what you want. If so,
ask back on how to make the form "unset" all the boolean fields when
you start the form initially - so you start from scratch, on each run
of the form.

HTH,
TC (MVP Access)
http://tc2.atspace.com
 
I've tried this but the code returns a compile error on the ( * ). Is
there something missing ?

Also, once I get this working, how do I unset all the boolean fields
when I start the form from scratch ?

Thanks
 
Back
Top