Page Break at new letter (Report)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In creating a phone directory, I've gotten most of the bases covered...I've
got my 2 columns, I'm "trimming" & "shrinking" fields, etc. But I can't
figure out how to break at a new letter. (e.g. A, B, C, D, etc.)

Any assistance would be greatly appreciated as stick on A-B-C tabs are
costly, and a nuisance.
 
In the report's underlying query add a computed column which returns the
first letter of each name, e.g.

SELECT *, LEFT(LastName,1) AS FirstLetter
FROM Contacts;

You can then group the report by the FirstLetter column (you don't need to
show it on the report) and in the group footer set the ForceNewPage property
to 'After Section'. This should be the outermost group level with other
sort/group levels below this e.g. LastName and FirstName.

Ken Sheridan
Stafford, England
 
daizycow said:
In creating a phone directory, I've gotten most of the bases
covered...I've
got my 2 columns, I'm "trimming" & "shrinking" fields, etc. But I can't
figure out how to break at a new letter. (e.g. A, B, C, D, etc.)

Any assistance would be greatly appreciated as stick on A-B-C tabs are
costly, and a nuisance.

In the Query you use as RecordSource for the Report, include a Calculated
Column to extract the first Character of the Field you are going to use to
order the names:

FInit: Left([yourcolumnsname],1)

In your report, in the upperleftmost corner, click the little box to select
it, then right click, and choose Sorting and Grouping. Group by FInit, and
set to show a Group Header and Group footer. In he Group Header, display
FInit (and titles for the columns that will appear in the detail, if you
wish... many phonebooks assume the meaning of the columns is obvious and
don't show titles), in the Detail Section display the information you want,
and display nothing in the Group Footer, but in its Property Sheet, set
either Force New Page or New Row or Col to After Section (whichever is your
preference).

I think that may do what you want.

Note: if you were thinking, why not do a New Row or Col as BeforeSection in
the Group Header -- try it, and it will be obvious.

If your phonebook has relatively few entries, you might not want to start a
new column or page for each first letter, but just separate them by a bold
display of first letter in the Group Header. A little careful googling will
bring up suggestions for showing the first and last "first letters" in one
of the page header/footer areas, if you decide you don't have enough to
warrant page or column breaks.

Larry Linson
Microsoft Access MVP
 
Back
Top