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!

Report List

Status
Not open for further replies.

kastaman

IS-IT--Management
Sep 24, 2001
181
CA
Hello,

I hope one of you guys can provide a solution for my problem.

I have a report where the the clients are listed alphabetically. Now what they need is to split the clients into 3 categories (A,B,C)alternately from the original list.

For example:
CLIENT NAME - CATEGORY
Abe - A
Ark - B
Bab - C
Bin - A
Cut - B
Dol - C

Then re-sort the report header according to the Categories Thanks in advance,

Kastaman
 
Just add a category field to your table or query and then add category to the sorting and grouping in your report. Maq [americanflag]
<insert witty signature here>
 
Hi there,

I was hoping for an automated way of inputting the categories. Basically the category repeats every third line. Thanks in advance,

Kastaman
 
Are you saying Category is a new field in the table and needs to be filled in?

I use Access 97, so i'll do it with DAO. For ADO, make the necessary changes.

Sub InsertCategory()
Dim rst As DAO.Recordset
Dim I As Long
Set rst = CurrentDb.OpenRecordset(&quot;Table/Query/SQL&quot;)
With rst
Do Until .EOF
.Edit
!Category=Chr(65 + (I Mod 3))
.Update
I= I + 1
.MoveNext
Loop
.Close
End With
Set rst = Nothing
End Sub

Make sure your recordset is sorted properly, otherwise you'll be surprised of how bad things go, and I won't take the blame...

After that, do what Maquis said.

Did I get it entirely wrong?

Dan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top