Printing a singlepaged Report

  • Thread starter Thread starter spnz via AccessMonster.com
  • Start date Start date
S

spnz via AccessMonster.com

Hello!!

I have made up a reference letter for employees ( I work for a company that
hires large amounts of temp workers) I am asked all the time to write
reference letters for them to get bank accounts,NI numbers,etc etc. So been
lazy I am trying to save a heap of time by been able to print a reference
letter straight from my database.

I have a form that generates a query which then passes all of the required
information onto a report.

Currently I have a command button that opens the report, I then must click
on the print then select print pages 1 - 1. If I click the printer icon
then all records are printed.

How can I make the command button on the form print only that record?

Can anyone help out?
 
Base your report on a query that includes EmployeeID and set the criteria
for that field to:
Forms!NameOfYourForm!EmployeeID
Note that EmployeeID must actually be on your form (it can be invisible).
 
Hello!!

I have made up a reference letter for employees ( I work for a company that
hires large amounts of temp workers) I am asked all the time to write
reference letters for them to get bank accounts,NI numbers,etc etc. So been
lazy I am trying to save a heap of time by been able to print a reference
letter straight from my database.

I have a form that generates a query which then passes all of the required
information onto a report.

Currently I have a command button that opens the report, I then must click
on the print then select print pages 1 - 1. If I click the printer icon
then all records are printed.

How can I make the command button on the form print only that record?

Can anyone help out?

Your table should have a unique prime key field.

If so, code the Form's command button's Click event:
DoCmd.OpenReport "ReportName", acViewPreview, , "[EmployeeID] = " &
[EmployeeID]

The above assumes a [EmployeeID] field that is a Number Datatype.

If [EmployeeID] is Text Datatype, then use:

"[EmployeeID] = '" & [EmployeeID] & "'"

as the Where clause.
Change the field name to whatever the actual field name is that you
are using.

See Access Help files for:
Where Clause + Restrict data to a subset of records'
 
Thanks PC Datasheet & Fredg


I went for fredgs option as it worked best for my requirement..



Thanks again!
 
Back
Top