![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm trying to "hide" a report while printing. I need to open the report in preview mode as so to count the pages (if multiple so I can set the printer to duplex printing) and then print the number of copies collected via input box. I've tried every combination I can think of to suppress the report "popping up" and then going away. Here's an example of what I'm doing. stDocName = "rptMyReport" intCopies = InputBox("Enter the number of copies to print", "Copies", 1, 5000, 4000) DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" SNIP |
#3
| |||
| |||
|
|
I'm trying to "hide" a report while printing. I need to open the report in preview mode as so to count the pages (if multiple so I can set the printer to duplex printing) and then print the number of copies collected via input box. I've tried every combination I can think of to suppress the report "popping up" and then going away. Here's an example of what I'm doing. stDocName = "rptMyReport" intCopies = InputBox("Enter the number of copies to print", "Copies", 1, 5000, 4000) DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" 'Check to see the number of pages. If it is greater than 1, the printer is set to duplex printing If Reports!rptMyReport.Pages > 1 Then Set prtFirst = Application.Printers(0) With Reports(stDocName).Printer .Duplex = acPRDPVertical End With DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False With Reports(stDocName).Printer .Duplex = acPRDPSimplex End With DoCmd.Close acReport, stDocName, acSaveNo Else DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False DoCmd.Close acReport, stDocName, acSaveNo End If stDocName = "" Exit Sub 'Error Handler Error_Handler: MsgBox err.Description DoCmd.CancelEvent Any suggestions would be greatly appreciated. I don't have much hair left. :-) |
#4
| |||
| |||
|
|
brian.flann... (AT) ci (DOT) verona.wi.us wrote: I'm trying to "hide" a report while printing. *I need to open the report in preview mode as so to count the pages (if multiple so I can set the printer to duplex printing) and then print the number of copies collected via input box. *I've tried every combination I can think of to suppress the report "popping up" and then going away. Here's an example of what I'm doing. stDocName = "rptMyReport" intCopies = InputBox("Enter the number of copies to print", "Copies", 1, 5000, 4000) DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" * 'Check to see the number of pages. *If it is greater than 1, the printer is set to duplex printing * If Reports!rptMyReport.Pages > 1 Then * * Set prtFirst = Application.Printers(0) * * With Reports(stDocName).Printer * * * * .Duplex = acPRDPVertical * * End With * * DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False * * With Reports(stDocName).Printer * * * * .Duplex = acPRDPSimplex * * End With * * DoCmd.Close acReport, stDocName, acSaveNo Else * * DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" * * DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False * * DoCmd.Close acReport, stDocName, acSaveNo End If * stDocName = "" Exit Sub * * 'Error Handler Error_Handler: * * MsgBox err.Description * * DoCmd.CancelEvent * Any suggestions would be greatly appreciated. *I don't have much hair left. *:-) MG Fosters is beneficial when opening a report. *I suppose if the report is open, the property you can experiment with is Visible to hide it. * * * * Me.Visible = False * * * * Me.Visible = True Since reports print quickly, I'm not sure why you want to Hide the report. *I think this would cause some flicker or maybe confusion as it becomes visible and invisible. *Maybe the hourglass would work just as well. * * * * Docmd.Hourglass True * * * * Docmd.Hourglass False and this would show there's an action occurring while the housglass is visible. *Just a thought. |
#5
| |||
| |||
|
|
brian.flann... (AT) ci (DOT) verona.wi.us wrote: I'm trying to "hide" a report while printing. I need to open the report in preview mode as so to count the pages (if multiple so I can set the printer to duplex printing) and then print the number of copies collected via input box. I've tried every combination I can think of to suppress the report "popping up" and then going away. Here's an example of what I'm doing. stDocName = "rptMyReport" intCopies = InputBox("Enter the number of copies to print", "Copies", 1, 5000, 4000) DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" 'Check to see the number of pages. If it is greater than 1, the printer is set to duplex printing If Reports!rptMyReport.Pages > 1 Then Set prtFirst = Application.Printers(0) With Reports(stDocName).Printer .Duplex = acPRDPVertical End With DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False With Reports(stDocName).Printer .Duplex = acPRDPSimplex End With DoCmd.Close acReport, stDocName, acSaveNo Else DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False DoCmd.Close acReport, stDocName, acSaveNo End If stDocName = "" Exit Sub 'Error Handler Error_Handler: MsgBox err.Description DoCmd.CancelEvent Any suggestions would be greatly appreciated. I don't have much hair left. :-) MG Fosters is beneficial when opening a report. I suppose if the report is open, the property you can experiment with is Visible to hide it. Me.Visible = False Me.Visible = True Since reports print quickly, I'm not sure why you want to Hide the report. I think this would cause some flicker or maybe confusion as it becomes visible and invisible. Maybe the hourglass would work just as well. Docmd.Hourglass True Docmd.Hourglass False and this would show there's an action occurring while the housglass is visible. Just a thought. |
#6
| |||
| |||
|
|
On Mar 27, 1:54 pm, Salad <o... (AT) vinegar (DOT) com> wrote: brian.flann... (AT) ci (DOT) verona.wi.us wrote: I'm trying to "hide" a report while printing. I need to open the report in preview mode as so to count the pages (if multiple so I can set the printer to duplex printing) and then print the number of copies collected via input box. I've tried every combination I can think of to suppress the report "popping up" and then going away. Here's an example of what I'm doing. stDocName = "rptMyReport" intCopies = InputBox("Enter the number of copies to print", "Copies", 1, 5000, 4000) DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" 'Check to see the number of pages. If it is greater than 1, the printer is set to duplex printing If Reports!rptMyReport.Pages > 1 Then Set prtFirst = Application.Printers(0) With Reports(stDocName).Printer .Duplex = acPRDPVertical End With DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False With Reports(stDocName).Printer .Duplex = acPRDPSimplex End With DoCmd.Close acReport, stDocName, acSaveNo Else DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False DoCmd.Close acReport, stDocName, acSaveNo End If stDocName = "" Exit Sub 'Error Handler Error_Handler: MsgBox err.Description DoCmd.CancelEvent Any suggestions would be greatly appreciated. I don't have much hair left. :-) MG Fosters is beneficial when opening a report. I suppose if the report is open, the property you can experiment with is Visible to hide it. Me.Visible = False Me.Visible = True Since reports print quickly, I'm not sure why you want to Hide the report. I think this would cause some flicker or maybe confusion as it becomes visible and invisible. Maybe the hourglass would work just as well. Docmd.Hourglass True Docmd.Hourglass False and this would show there's an action occurring while the housglass is visible. Just a thought. I've tried several different combinations using "acHidden" as well as "Me.Visible" and even have gone so far as trying "Echo". The only way everything seems to work properly is the way I have posted. Other combinations either don't print right (i.e. number of copies), or don't filter at all (the Where Condition) or don't set the printer properly. I'll be the first to admit that the db in question probably isn't the most efficient or even properly laid out. I'm sure the design of the form which is open while all of this takes place is mostly to blame. I'm not a professional developer. Most of my "real" db design education has been through trial and error, or by reading and applying the vast knowledge of the many wonderful posters within this group. That being said, what may be making this problem more significant is the fact that we are using Shrinker Stretcher to enlarge the view. The db was originally designed based on the screen resolution of a 15" laptop and is now being viewed by three users on 22" monitors. The dynamic SS utility seems to slow down the screen reaction time which I'm sure is mostly because the main user form is pretty "busy". Like I said, it's probably a poor design, but the main user form is a form, with a tab control and twelve subforms. I don't know what the magic number of subforms should be, but good or bad, it's really efficient for the way we do business. We rely on going to one record within the form and then switching to related information on the various subforms- and back and forth between the tabs. It's a municipal permit db. So we go to a permit, and then tab from contractors to fees, inspections, pictures, etc. I've thought about switching to pop up forms but I think it would become too cumbersome having to continually open and close forms all the time. Anyway, back to the question at hand... When the user opts to print the report, the report "flashes" but then the screen hangs while (I'm assuming) it needs to repaint itself which takes what seems like an eternity and from a purely visual standpoint, looks like crap. I've got to believe that there is a simple way that I'm overlooking that would "force" the report to do it's thing behind the form and out of sight. Well, I've bared my soul for both ridicule and help. Thanks for letting me ramble on. Again, any thoughts, suggestions and direction would be appreciated. Thanks again. |
#7
| |||
| |||
|
|
brian.flann... (AT) ci (DOT) verona.wi.us wrote: On Mar 27, 1:54 pm, Salad <o... (AT) vinegar (DOT) com> wrote: brian.flann... (AT) ci (DOT) verona.wi.us wrote: I'm trying to "hide" a report while printing. *I need to open the report in preview mode as so to count the pages (if multiple so I can set the printer to duplex printing) and then print the number of copies collected via input box. *I've tried every combination I can think of to suppress the report "popping up" and then going away. Here's an example of what I'm doing. stDocName = "rptMyReport" intCopies = InputBox("Enter the number of copies to print", "Copies", 1, 5000, 4000) DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" *'Check to see the number of pages. *If it is greater than 1, the printer is set to duplex printing *If Reports!rptMyReport.Pages > 1 Then * *Set prtFirst = Application.Printers(0) * *With Reports(stDocName).Printer * * * *.Duplex = acPRDPVertical * *End With * *DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False * *With Reports(stDocName).Printer * * * *.Duplex = acPRDPSimplex * *End With * *DoCmd.Close acReport, stDocName, acSaveNo Else * *DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" * *DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False * *DoCmd.Close acReport, stDocName, acSaveNo End If *stDocName = "" Exit Sub * *'Error Handler Error_Handler: * *MsgBox err.Description * *DoCmd.CancelEvent *Any suggestions would be greatly appreciated. *I don't have much hair left. *:-) MG Fosters is beneficial when opening a report. *I suppose if the report is open, the property you can experiment with is Visible to hide it. * * * *Me.Visible = False * * * *Me.Visible = True Since reports print quickly, I'm not sure why you want to Hide the report. *I think this would cause some flicker or maybe confusion as it becomes visible and invisible. *Maybe the hourglass would work just as well. * * * *Docmd.Hourglass True * * * *Docmd.Hourglass False and this would show there's an action occurring while the housglass is visible. *Just a thought. I've tried several different combinations using "acHidden" as well as "Me.Visible" and even have gone so far as trying "Echo". *The only way everything seems to work properly is the way I have posted. *Other combinations either don't print right (i.e. number of copies), or don't filter at all (the Where Condition) or don't set the printer properly. I'll be the first to admit that the db in question probably isn't the most efficient or even properly laid out. * I'm sure the design of the form which is open while all of this takes place is mostly to blame. I'm not a professional developer. *Most of my "real" db design education has been through trial and error, or by reading and applying the vast knowledge of the many wonderful posters within this group. That being said, what may be *making this problem more significant is the fact that we are using Shrinker Stretcher to enlarge the view. The db was originally designed based on the screen resolution of a 15" laptop and is now being viewed by three users on 22" monitors. *The dynamic SS utility seems to slow down the screen reaction time which I'm sure is mostly because the main user form is pretty "busy". *Like I said, it's probably a poor design, but the main user form is a form, with a tab control and twelve subforms. *I don't know what the magic number of subforms should be, but good or bad, it's really efficient for the way we do business. *We rely on going to one record within the form and then switching to related information on the various subforms- and back and forth between the tabs. *It's a municipal permit db. *So we go to a permit, and then tab from contractors to fees, inspections, pictures, etc. *I've thought about switching to pop up forms but I think it would become too cumbersome having to continually open and close forms all the time. *Anyway, back to the question at hand... When the user opts to print the report, the report "flashes" but then the screen hangs while (I'm assuming) it needs to repaint itself which takes what seems like an eternity and from a purely visual standpoint, looks like crap. *I've got to believe that there is a simple way that I'm overlooking that would "force" the report to do it's thing behind the form and out of sight. Well, I've bared my soul for both ridicule and help. *Thanks for letting me ramble on. *Again, any thoughts, suggestions and direction would be appreciated. *Thanks again. What happens if you were to open the report hidden. *Then get the page count and store it to a variable. *BTW, are you sure Printers(0) will always be the same printer for every user? Maybe then set (assumes the report will use the default printer), the setting for it first (I might want to store the defaults first) and then close the report then loop thru the number of copies. |

#8
| |||
| |||
|
|
'Check to see the number of pages. If it is greater than 1, the printer is set to duplex printing |
#9
| |||
| |||
|
|
On Mar 28, 10:22 am, Salad <o... (AT) vinegar (DOT) com> wrote: brian.flann... (AT) ci (DOT) verona.wi.us wrote: On Mar 27, 1:54 pm, Salad <o... (AT) vinegar (DOT) com> wrote: brian.flann... (AT) ci (DOT) verona.wi.us wrote: I'm trying to "hide" a report while printing. I need to open the report in preview mode as so to count the pages (if multiple so I can set the printer to duplex printing) and then print the number of copies collected via input box. I've tried every combination I can think of to suppress the report "popping up" and then going away. Here's an example of what I'm doing. stDocName = "rptMyReport" intCopies = InputBox("Enter the number of copies to print", "Copies", 1, 5000, 4000) DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" 'Check to see the number of pages. If it is greater than 1, the printer is set to duplex printing If Reports!rptMyReport.Pages > 1 Then Set prtFirst = Application.Printers(0) With Reports(stDocName).Printer .Duplex = acPRDPVertical End With DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False With Reports(stDocName).Printer .Duplex = acPRDPSimplex End With DoCmd.Close acReport, stDocName, acSaveNo Else DoCmd.OpenReport stDocName, acViewPreview, "", "My Filter" DoCmd.PrintOut acPrintAll, , , acHigh, intCopies, False DoCmd.Close acReport, stDocName, acSaveNo End If stDocName = "" Exit Sub 'Error Handler Error_Handler: MsgBox err.Description DoCmd.CancelEvent Any suggestions would be greatly appreciated. I don't have much hair left. :-) MG Fosters is beneficial when opening a report. I suppose if the report is open, the property you can experiment with is Visible to hide it. Me.Visible = False Me.Visible = True Since reports print quickly, I'm not sure why you want to Hide the report. I think this would cause some flicker or maybe confusion as it becomes visible and invisible. Maybe the hourglass would work just as well. Docmd.Hourglass True Docmd.Hourglass False and this would show there's an action occurring while the housglass is visible. Just a thought. I've tried several different combinations using "acHidden" as well as "Me.Visible" and even have gone so far as trying "Echo". The only way everything seems to work properly is the way I have posted. Other combinations either don't print right (i.e. number of copies), or don't filter at all (the Where Condition) or don't set the printer properly. I'll be the first to admit that the db in question probably isn't the most efficient or even properly laid out. I'm sure the design of the form which is open while all of this takes place is mostly to blame. I'm not a professional developer. Most of my "real" db design education has been through trial and error, or by reading and applying the vast knowledge of the many wonderful posters within this group. That being said, what may be making this problem more significant is the fact that we are using Shrinker Stretcher to enlarge the view. The db was originally designed based on the screen resolution of a 15" laptop and is now being viewed by three users on 22" monitors. The dynamic SS utility seems to slow down the screen reaction time which I'm sure is mostly because the main user form is pretty "busy". Like I said, it's probably a poor design, but the main user form is a form, with a tab control and twelve subforms. I don't know what the magic number of subforms should be, but good or bad, it's really efficient for the way we do business. We rely on going to one record within the form and then switching to related information on the various subforms- and back and forth between the tabs. It's a municipal permit db. So we go to a permit, and then tab from contractors to fees, inspections, pictures, etc. I've thought about switching to pop up forms but I think it would become too cumbersome having to continually open and close forms all the time. Anyway, back to the question at hand... When the user opts to print the report, the report "flashes" but then the screen hangs while (I'm assuming) it needs to repaint itself which takes what seems like an eternity and from a purely visual standpoint, looks like crap. I've got to believe that there is a simple way that I'm overlooking that would "force" the report to do it's thing behind the form and out of sight. Well, I've bared my soul for both ridicule and help. Thanks for letting me ramble on. Again, any thoughts, suggestions and direction would be appreciated. Thanks again. What happens if you were to open the report hidden. Then get the page count and store it to a variable. BTW, are you sure Printers(0) will always be the same printer for every user? Maybe then set (assumes the report will use the default printer), the setting for it first (I might want to store the defaults first) and then close the report then loop thru the number of copies. Not to sound stupid...but can you be a little more specific? I think I get where you're going, but I don't think I can get there. ![]() |
#10
| |||
| |||
|
|
brian.flann... (AT) ci (DOT) verona.wi.us wrote: *'Check to see the number of pages. *If it is greater than 1, the printer is set to duplex printing Why? * If you send multiple copies of a 1 page reports to a printer they each should print on their own sheet of paper and not print one on each side. If this is the case I'm quite curious as to the make and model of the printer and if the printer drivers are up to date? * Tony -- Tony Toews, Microsoft Access MVP * *Please respond only in the newsgroups so that others can read the entire thread of messages. * *Microsoft Access Links, Hints, Tips & Accounting Systems athttp://www.granite.ab.ca/accsmstr.htm * *Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/ |
![]() |
| Thread Tools | |
| Display Modes | |
| |