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!

Print Current Page in acViewPreview mode

Status
Not open for further replies.

XP2000

Programmer
Dec 14, 2001
40
GB
I have an Access 2002 report that has multiple pages and contains a customized toolbar. The buttons on the toolbar run macros which call VBA functions using the Runcode command.

I'm trying to work out a function that allows the user to print just the current page whilst in acviewpreview mode simply by clicking on a customized toolbar button.

Any thoughts?
 
what u need to do is..try to use the command button.and choose the Form Operatin and then select the Print Current Form..
hope that will help..
may the force be with you..
 
I don't follow.
This is a Report, not a Form.
 
UPDATE:
I thought I had this problem cracked when I created a routine that fired when the Report Footer got formatted, but it only fires on the first view of each page and not subsequent views.
The same thing happens for the Report Page event.

Can anyone help?
Surely there must be some way of detecting the current page number in an Access Report whilst in Preview mode?
 
Can you capture the current page number? If you could, you could just assign the code to print a range from the report. The range would just be something like.. from page4 to page4.

I looked up something i downloaded from microsoft, a printersettings db. It had a lot of settings you can assign through vba: portrait/landscape, bins, printe range, specific pritners; but it didn't have the current page property.

Would you let me know if you find a solution? Mark P.

Bleh
 
Looks like i posted right after you wrote your second post. Same idea. Mark P.

Bleh
 
I'm still struggling with this. There must surely be an easy way to capture the current page number in an Access Report preview?
 
I've inherited a Access db, is it a good idea to make myself the Admin? How could I do so?
 
Okay,

This might be a step in the right direction; its kind of what i said before. Have a pop up form that you print the report from. Open the report in view mode. Then locate the page you want to print(the pop upform will still float over the report the whole time). On the pop up form, have a text box for a the page number you want to print, have the output from start and end be the same as the text box. You can then have a button that closes the report, and opens in acNormal with the print range captured from the txt box. This idea doesn't grab the page number, but you are on you will have completed some steps you'll need to do anyways.

So consider the possibility that you can't capture the page number.Is there anyway else you can do what you want?
What does the report do? Can you section it up before you output it? Filters etc..? It seems no-one has any idea of how to capture the page #. Mark P.

Bleh
 
Unless they've changed things, the only way to programmatically print a certain page or pages or page range of a report is with the PrintOut method. Check it out in the help system. It's very basic.


Jim

Me? Ambivalent? Well, yes and no....
Another free Access forum:
More Access stuff at
 
oh, i figured he knew it was based on the printout action. thanks for clarifying. Mark P.

Bleh
 
Yes I've grasped the Printout function, but the question requires a command button on a customized toolbar that prints just the Current Page 7 times.

It seems like a reasonable enough request and it will save users time in going through the the routine of Print--->Set Page From, Set Page To and Set Number of Copies.

It would be SO much easier if we had a command button that would do that for them with just one click.

One solution may be (as suggested) to have a popup form where the user enters the page number, but a command button remains the preferred option.

The problem remains that we can find no way of detecting what the Current Page number is in Report Preview mode.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top