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.