Keeping "Header Item" and Total on the Same Line?

  • Thread starter Thread starter croy
  • Start date Start date
C

croy

I vaguely remember someone here having a trick in Access
where a header item and the first row of the details could
be on the same line... but I can't remember what it was, or
even what to call it so I can search for it!

Currently, I have a very simple report that pulls in invoice
totals and vendors, and shows the total for each vendor
(since a parameter date).

It would be really nice to just show:

[VendorName], [Total of Invoices]

.... without a lot of extra line spacing.

As it is now, it's more like:

[VendorName]

[Total of Invoices]

.... and it takes a lot of pages.

The trick?
 
One way is to not put text box in the header but put in detail and set the
Hide Duplicate property to Yes.
 
One possible way is to include Vendor Name and Total of Invoices in the group
header.

Add a new control to your detail section.
-- Name it txtCountLines
-- Set its record source to =1
-- Set its Running sum to over group

In the detail section's format event
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.Section(acDetail).Visible = me.txtCountLines <> 1
End Sub

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County
 
croy said:
I vaguely remember someone here having a trick in Access
where a header item and the first row of the details could
be on the same line... but I can't remember what it was, or
even what to call it so I can search for it!

Currently, I have a very simple report that pulls in invoice
totals and vendors, and shows the total for each vendor
(since a parameter date).

It would be really nice to just show:

[VendorName], [Total of Invoices]

... without a lot of extra line spacing.

As it is now, it's more like:

[VendorName]

[Total of Invoices]

... and it takes a lot of pages.

The trick?


Use a line of code in the group header's Format event:

Me.MoveLayout = False
 
Back
Top