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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2010 report header...

Status
Not open for further replies.

Webkins

Programmer
Dec 11, 2008
118
US
I have a report in Access 2010.
This report contains 31 pages.
On each page are approximately 32 part numbers with descriptions, sorted ascending, numerically by part number.

What I am trying to do is to put the first and last part number contained on each page of the report in the header or footer section to make searching through the report easier for the user to find their number. The report is constantly changing with the addition and deletion of part numbers so I need this to be dynamic. Just like in a phone book.

For example: Page 1 of 32 0000-0709, Page 2 of 32 0710-0993, Page 3 of 32 0994-1234 and so on.

I do not know what this is called, how to make it possible or what to search for here or in Google for more information.

Any suggestions will be greatly appreciated. Thanks a bunch.
 
The agregate functions should work in the control source in headers. So the first and last would be the Min and max so the range in a control source would look something like below...

Code:
=Min(PartNo) & "-" & Max(PartNo)

 
Min and Max won't work in Page sections.

I just created a report in the Northwind sample database. The report was on the Orders and Customers tables and grouped by CompanyName.

I added a text box in the Page Header section:
[tt]
Name: txtFirstCompanyName
Control Source: CompanyName

[/tt]

I added another text box in the Page Footer section:
[tt]
Name: txtLastCompanyName
Control Source: CompanyName

[/tt]

I then added code to store the first company value and then print both values in the Page Footer.

Code:
Option Compare Database
Dim strFirstValue As String

Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
    Me.CurrentX = 2000
    Me.CurrentY = 100
    Me.Print strFirstValue & " - " & Me.txtLastCompanyName
End Sub

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)
    strFirstValue = Me.txtFirstCompanyName
End Sub

Duane
Hook'D on Access
MS Access MVP
 
I didn't realize page headers and footers didn't work that way. I guess I've only done it on report and grouping headers/footers and assumed the behavior was the same.
 
lameid,
It's a common error when designing reports (especially one pagers) to place Sum() and other aggregates in the Page Footer section. I was hoping Access 2010 might have greater functionality but when I tested the aggregates they still didn't work.

Duane
Hook'D on Access
MS Access MVP
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top