Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Break a report into separate reports

Status
Not open for further replies.

jmhicsupt

MIS
Oct 22, 2005
49
US
Is there a way to break a report into separate reports? I have several employees that need their own report. So I wanted to just have several reports using the employee name and employee number as the name of the report.

Is this possible?

Thanks in advance.
 
If the query currently includes the employee number, put this in the criteria cell:

[Enter your employee number]


--Lilliabeth
DPMNOTTW
 
Is there a way to automatically generate separate reports based on the employee name and number? I exported this data from Excel, so the name and number are included on each records. It works great when I group by name and number in the report, but now I want to have a separate report automatically so I don't have to enter the number each time I want a separate report.
 
I use the following to open a report and send it to a PDF file as a separate report for each customer.

Yo can probably modify it to your needs.

HTH

Code:
Private Sub c1_Click()
Dim myDb1 As DAO.Database, myRst1 As DAO.Recordset, myFile As String, myCurName As String

DoCmd.Close acReport, "Sales_Report"

Set myDb1 = CurrentDb
Set myRst1 = myDb1.OpenRecordset("SELECT DISTINCT tblcust.cName FROM tblCust;", dbOpenDynaset)
myRst1.MoveFirst



Do While Not myRst1.EOF
myCurName = Replace(myRst1.Fields(0), ",", "")
myCurName = Replace(myCurName, "'", "")
myCurName = Replace(myCurName, ".", "")

myFile = myCurName & "_" & Year(Date) _
& Format(Month(Date), "mm") & Format(Day(Date), "dd")

DoCmd.Rename "Sales_Report_ " & myFile, acReport, "Sales_Report"
DoCmd.OpenReport "Sales_Report_ " & myFile, 0, , "[cName] = " & "'" & myCurName & "'", acHidden
DoCmd.Close acReport, "Sales_Report_ " & myFile, acSaveYes
DoCmd.Rename "Sales_Report", acReport, "Sales_Report_ " & myFile
DoCmd.Close acReport, "Sales_Report", acSaveYes
myRst1.MoveNext
Loop

End Sub

John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top