Link to home
Start Free TrialLog in
Avatar of gigo30
gigo30

asked on

A97 report: how to force column break

I have an Access 97 report that has 2 columns in the detail section. I just want to do a column break on certain detail records.

The table the report is based on has a Yes/No field, let's call it MyColBreak. When a detail record is printed and MyColBreak is true, I want to force the report to go to the next column. I have tried setting the NewColOrRow property in the report, using code in the report's Detail_Format, but that didn't work. I also put this code in the Group Header Format event.

Note that these detail records are also grouped and I have the KeepTogether property set to True so no group will span between columns.

How do I do this?

Avatar of brewdog
brewdog

Is there some rhyme or reason to the records you have marked as MyColBreak? Would it be possible to set up another group level instead?
Avatar of gigo30

ASKER

Yes there is a reason. These are 1 page reports. I want the details of the report to look as balanced as possible. So 10 details in the right column, and 9 details in the left would be about balanced.

My table is set up like this:
- Itemnum (unique id)
- Class (text field)
- Group (number field)
- Item (text field describing item)
- Itemorder (number field. Used so if I insert items between existing items 5 and 10, it will be in the right position.)
- Header (yes/no field)
- MyColBreak (yes/no field)

If Header=true then I make a text box in the report detail use a grey background. Otherwise I make the other text box in the detail visible.

The users of these reports are real picky so I have to do a manual column break sometimes.
ASKER CERTIFIED SOLUTION
Avatar of brewdog
brewdog

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gigo30

ASKER

I'll try #1. That might work.

Can't do #2. These records must be in a specific vertical order.
I thought that might be the case, but it was worth a shot.
Avatar of gigo30

ASKER

I made another grouping called ColumnGroup. It works in most cases where both columns will not fit in the first column. But when I only have a few items, and both column groups will fit in one column, I get an extra blank page after the report. This is because I had to set the ColumnGroup group footer property "NewRoworCol" to "After section". Also in the grouping/sorting window, for that group I have "Keep together" set to "Whole group".

How do I get rid of that blank page? Actually, it's a page with a header and footer, but no details. It seems I would have to set the group footer ColumnGroup property "NewRoworCol" to "None".  But then for a short report, all items will print in the first column.

Hundreds (about 550) of these reports will print when they are printed, and I don't want to end up with hundreds of unusable pages.
Avatar of gigo30

ASKER

Also, the NewColorRow property of the group header or footer is only settable in VBA when the report is in design mode. But when the report formats column 2, I can't really go back to design mode and set NewRoworCol to "None".

I just want to force a column break for certain detail records.
Avatar of gigo30

ASKER

Edited text of question.
Avatar of gigo30

ASKER

#1 worked. By adding another group field to break on a group.
Sorry I wasn't able to get back on this more quickly. Is this still "mostly" working, or is it *really* working now?
Avatar of gigo30

ASKER

Well, when the 2 column groups will both fit on 2 columns, I had to add blank records to the end of column 1, then it would break properly.

Otherwise, it worked fine.
good workaround. That is the lion's share of programming, I find.
Avatar of gigo30

ASKER

Should have read:
Well, when the 2 column groups will both fit on 1 column, I had to add blank records to the end of the records for column 1, then it would break properly.