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

Listing records differently

Status
Not open for further replies.

bobmunkhouse

Technical User
Feb 23, 2003
14
US
I have a list of names in a table.

In a report they display one below the other. Can I make them appear one after the other instead:

name, name, name, name, name, name, name, name, name, name, name, name, name, name, name, name, name, name, name, name, name, name, etc.

Please help
 
bob:

In the report design mode, click on File, Page Setup... on the main menu. Then click on the Columns tab.

There is where you give it all the pertinent information about how many columns, their size and the space between them, etc. You then need to put the same number of text boxes across the page as the number of columns you chose and set all their Control Sources to the same field in your recordset.

You might have to tweak the positions and sizes of the textboxes to make sure everything fits on the width of your paper.

HTH,

Vic
 
Or...

You could try something like this:

Place the text box on the report and name it txtName. Then put this code in the Detail_Format sub

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

Dim db As Database
Dim rst As Recordset
Dim strNames As String

Set db = CurrentDb()
Set rst = db.OpenRecordset("Select [FName] From [tblNames] Order By [FName]", dbOpenDynaset)

If Not rst.EOF Then

rst.MoveFirst
strNames = ""

Do While Not rst.EOF

strNames = strNames & rst.Fields(0) & "'"
rst.MoveNext

Loop

strNames = Mid(strNames, 1, Len(strNames) - 1)

Me.txtName = strNames

End If

End Sub

I hope this helps.

BAKEMAN [pimp]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top