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!

Multiple records on the same line in a report

Status
Not open for further replies.

jrmont

Technical User
Jul 1, 2003
8
US
I need to create a report that groups foods into goodgroups displayed 4 per line. Each food is in the name field of a table called allfoods. The output would look like this:

Fruit

Apple Peach Banana Strawberry
Pear Plum Orange Nectarine

Vegetable

Peas Carrot Corn Squash


Is there a way to do this using in a report? I understand how to group in a report. The trick here is to get this columnar output.
 
I need a bit more info to help you here, what do your tables look like?

I assume they may look some thing like this

Fruit Apple
Fruit Peach
Fruit Banana

in which case you would need a crosstab query.

Please get back to me with an outline of the structure of the tables that you are using.
 
What you describe is correct. If the query for my report is

select foodname from allfoods group by foodgroup I will get:

Fruit

Banana
Apple
Peach


Vegetable

Corn
Peas
Carots

Please tell me what you have in mind.
 
I think what you need to do is create a crosstab query (use the wizard if you can).

It is still difficult for me to ascertain how to build the crosstab based on the data you have given me.

Have a look at the help for crosstab queries then build on using the wizard and then build your report based on that crosstab query.

Get back to me if you have any problems.
 
You can make Access print data horizontally without creating crosstabs. Open the report in design view and go to File -> Page Setup. Click on the 'Columns' tab. Here you can change the number of columns that Access prints from 1 to 4. You will probably also have to adjust the column size setting, probably make it just a bit larger than the size of the field on the report's designer grid. T

-Gary
 
Thank you both for the ideas. I used Gary's suggestion and set the page properties for 4 columns. Then, it was necessary to set the new row and column property of the group header and detail sections to get the required output. The result is perfect.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top