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

Help with Report, please...

Status
Not open for further replies.

mosmas

Technical User
May 22, 2003
61
US
I have a query that the following fields:
Name Call Date
---- ---------
mmsenda 2/28/02
mmsenda 5/3/02
mmsenda 6/05/02
john 6/05/02
john 7/05/02
mmsenda 8/05/03

When I create a report and group by name, it prints like this:

mmsenda
2/28/02
5/3/02
6/05/02
8/05/03
John
6/05/02
7/05/02

Is there any way that I can setup my report so that it will print
like this:

mmsenda 2/28/02 5/3/02 6/05/02 8/5/02
John 6/05/02 7/05/02

If there is, how do we go about setting it up this way. Please advise.

Mosmas
 
Mosmas
I looked at this earlier and tried to figure some things out, but couldn't get quite the format your post says you want. Part of it depends on how many possible CallDates there are for a name. And there isn't much information about your database to go on.

So I don't know how much this will help, but here's a stab at something, since I see no other post in reply.
1. Do one Sort and Group on the Name, keep the group together, and put a Group footer. Then on the Name field in the report, Hide Duplicates.
2. Do a second Sort and Group on the CallDate.
3. Put the Name and CallDate fields on the same line in the report. In the Page Setup, set things up for as many columns as you can put across a page, setting each column width as narrowly as possible to still contain the data.

I was wondering, depending on the rest of the fields in your database, about setting something up in a Crosstab query, to do the grouping at the query level.

Anyway...good luck.

Tom
 
Out of curiosity, why didn't you post this in the Report Forum?


"It's got to be the going,
not the getting there that's good!"
-Harry Chapin
 
Hi Mosmas,

The only way I could think of doing this would be via sorting/code together.

1)Sort your report via Name and create a header for the name section.

2)In the Name header you place your txtName and a label beside it which would have a caption = "" (make sure the label will be the appropriate size to display the dates).

3)Then enter the following code for the Detail_Format procedure:

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
Me.lblYourLabelName.Caption = ""
End Sub


4)Then enter something like the following code in the NameHeader_Format Procedure:

Private Sub NameHeader_Format(Cancel As Integer, FormatCount As Integer)

Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset("tblYourTableName", dbOpenDynaset)
With rst
.MoveFirst
While .EOF = False
If !Name = Me.txtYourNameTextBox.Value Then
Me.lblYourLabelName.Caption = Me.lblYourLabelName.Caption & " " & !Calldate
End If
.MoveNext
Wend

End With
rst.Close
End Sub



Let me know if this helps.


Regards,
gkprogrammer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top