INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Two-page report with one difference between the two

Two-page report with one difference between the two

(OP)
Hello


One of our reports currently has additional data on it that is intended for the customer only. To fix this, I am hoping to basically copy the report to a second page. Then on that second page, I can make that data invisible.


Where should I put the page break to get a second page?


Thanks.

RE: Two-page report with one difference between the two

You can place the page break where ever you want. I would probably add some code to set the visible property of controls to No for controls I wanted to hide.

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016

RE: Two-page report with one difference between the two

(OP)
I added in the page break, but no additional work-space is created for me to duplicate the report.

I'm attaching a picture to give a general idea of what I'm trying to do.



I want the two pages to be identical, but page two just has a couple controls set to be non-visible. I can get the controls set to how I want them, but I can't get a duplicate page to show up.

RE: Two-page report with one difference between the two

Another approach would be to run the report twice, first time controls visible, second time controls not visible if this is run number 2.

RE: Two-page report with one difference between the two

So you are printing all of this in one report like a copy for customer and copy for you?

I would create a small
tblCopies
CopyNum    CopyTitle
-------    ---------
1          Customer
2          Us 

Make a copy of the report design...
Then add this table to your report's record source and don't join it to anything. This will create duplicates of every record. Add both new fields to the record source.

Add a group on CopyNum in your report's design. You can then change your control sources of the switchable controls to something like:
=IIf([CopyNum]=1,"",[Field1 To Hide])
=IIf([CopyNum]=1,"",[Field2 To Hide]) 

You could also set the tag property of controls to hide to something like
Tag: HideMe
Then use code to check for HideMe in the tag and set the Visible property based on CopyNum. I believe CopyNum would need to be bound to a control in the report.

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016

RE: Two-page report with one difference between the two

Couldn't this be done with one report and no table? In the vba for the print event, have a hidden text box on the form or do an open args in second print statement.
Pseudo code for form text box approach (assuming this is a button click event:

CODE

'put in before first print statement
me.txtCopyNum=1 'reset copynum to 1
docmd.print etc....
me.txtCopyNum=2
docmd.print etc... 

Then in the report as Duane showed:

CODE

=IIf(Forms!YourFormName.txtCopyNum=1,"",[Field1 To Hide])
=IIf(Forms!YourFormName.txtCopyNum=1,"",[Field2 To Hide]) 

RE: Two-page report with one difference between the two

(OP)
Sorry for the long delay. Priorities got diverted.

I have copied the report and saved it as a second report. Then I added the second report as a subreport in the report footer of the main report.

The only remaining problem I am having is that the page header is displayed on the same page as when the subreport begins. How can I access the VBA to add some code to turn all those controls in the page header off only on the page that the subreport begins?

RE: Two-page report with one difference between the two

So you didn't take advice from either me or sxschech?

Did you try my method?

Duane
Vevey, Switzerland
Hook'D on Access
MS Access MVP 2001-2016

RE: Two-page report with one difference between the two

(OP)
Sxschech suggested that I run the report twice; so I thought he was suggesting the subreport option.

A quick solution was needed, which is why I chose Sxschech's, because this report is used daily. Now that it's in a somewhat usable state, I can try implementing your suggestion.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close