Report printing and layout

joe31709

Registered User.
Local time
Yesterday, 23:06
Joined
May 12, 2003
Messages
54
I have to make a report that will print for each user that i have in my database. It is there timesheets. I want to be able to hit a button and print the reports one user per sheet.

How do I make it print one user and the info associated with that user per page?

Joe
 
Joe,

On the main form, where the user's timecard is displayed, make
a new command button. In its OnClick event, put:

DoCmd.OpenReport "YourReport",,,"[EmpID] = " & Me.EmpID

That assumes that EmpID is numeric and is the name of your
key field in the employee table and that EMPID is a control
on your form that holds it.

Wayne
 
Hi Joe

I think Wayne's answer will allow you to print 1 employee at a time whereas I think you want to print all employees but 1 per page.

As Wayne said put a command button on your form to enable the report, if you use the Wizard on the toolbar it will complete the code for you, then in your Report in Design View select grouping and group by employee then click the Section header and select force new page for each group.

Hope this helps

Brian
 
To print each record on a separate page, set the ForceNewPage property of the detail section to After Section.

IMO
 
WayneRyan said:
Joe,

On the main form, where the user's timecard is displayed, make
a new command button. In its OnClick event, put:

DoCmd.OpenReport "YourReport",,,"[EmpID] = " & Me.EmpID

That assumes that EmpID is numeric and is the name of your
key field in the employee table and that EMPID is a control
on your form that holds it.

Wayne

is there a way to make it print with out having to put in the last name. A box jumps up and you have to type the name, would like it just to print that record when I am on it and hit print. Without having to type in last name.

Thanks

Joe
 
Joe,

With this method, you don't have to type in the last name.

DoCmd.OpenReport "YourReport",,,"[EmpID] = " & Me.EmpID

I the example above, you substitute:

YourReport = The name of your report
[EmpID] = The name of a unique field in your table
Me.EmpID = The name of the control on your form that
corresponds to the [EmpID] in your table. If you haven't
changed it to a "meaningful" name, it is probably "Text7" or
something like that.

Wayne
 
Joe,

Can you Compact/Repair your db, then ZIP it and post it here.

Wayne
 

Users who are viewing this thread

Back
Top Bottom