Access Labels

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

Guest

I have successfully created a label report and I would like to know how to
print only one label at a time instead of a full sheet. If you reply with
code could you advise me where to apply the code as well.
Thanks in advance
Lee
 
I have successfully created a label report and I would like to know how to
print only one label at a time instead of a full sheet. If you reply with
code could you advise me where to apply the code as well.
Thanks in advance
Lee

OK. Let's say you have a table with 100 records in it and you wish to
print out just 1 of those 100 records.

1) One way would be to add a Check box field to the table.
Name it "Select"

Add this field to your form.
Add a command button to the form.
Code It's Click event:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview, , "[Select] = -1"

Open the form and select the record(s).
Only those records that have been selected will print.

After printing, clear the selection, either manually or by code.

2) Alternatively, you can code the command button (without using the
Check box at all):

DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport "ReportName", acViewPreview , , "[RecordID] = " &
Me![RecordID]
This assumes your table has a Prime Key unique field (it should) of a
Number datatype.

Only the one record displayed on the form at the time the command
button is clicked will print.

The first method permits multiple records to be printed at on time.
 
I think the easiest way is to:

1. Make a query based on the report.

2. Select the record you want using the Query criteria.

3. Set the "Record Source" property of your Report to the Query name.

--
---------------------------------------------------------------
Michael J. Strickland
Quality Services (e-mail address removed)
703-560-7380
---------------------------------------------------------------
I have successfully created a label report and I would like to know how to
print only one label at a time instead of a full sheet. If you reply with
code could you advise me where to apply the code as well.
Thanks in advance
Lee
 
Back
Top