views:

836

answers:

3

For a report in MS Access (2007) I need to put data of some columns on all odd pages and other columns on all even pages. It is for printing out double sided card files onto sheets of paper.

Does somebody have an idea how to do that?

+1  A: 

Your question is too general. I would suggest you have all columns in all pages, and then add some code to the page header section (or even in the detail section) "On Format" to change the .Visible property of your Detail text boxes depending on the page number.

I think you'll need to have a Text Box in the page header or footer with "=[Page]" as source data in order to know the correct page number. My Access report knowledge might be severely outdated, though.

ΤΖΩΤΖΙΟΥ
I just tried this, and couldn't get the "visible" property to work on reports.
CodeSlave
What event did you use? .Visible for controls works only in certain events.
David-W-Fenton
I seem to remember a David W Fenton from comp.database.ms-access once upon a time :)
ΤΖΩΤΖΙΟΥ
I've got it working now (in the On Format event). I mistyped it and of course it doesn't show up in the IntelliSense when you are working on the VBA for a report. I still stand by my other answer though :)
CodeSlave
+1  A: 

Well you can check whether "Page" is odd or even in an "On Format" event and maker columns visible or not visible depending on which page you are on. However, it would be far easier to:

Put in a couple of sections and put in a new page between them. Then it's just a matter of ensuring that you don't overflow the page with too many rows per card.

OR

Make the report wide enough that it forces a second page and then place those columns on a second page (i.e. the back of the first page). As I recall access's print order is left right top bottom, so pages set up like this:

A B  
C D

would print like this:

A
B
C
D

In the case of having to display data from the same record on two consecutive pages, this is the option I would choose.

CodeSlave
A: 

You could alternatively use a pair of queries, printing the first to side A, and the second to side B, perhaps?

warren