MoonDoggie
asked on
Using Winspool.drv to print an access report
I would like to click a button on an Access form (Access 2003) and open the print dialog, set properties (in this case 2-sided printing) and print a report that I've passed in. I have code that uses the winspool.drv API to open the print dialog but it doesn't print anything, just sets properties but then they don't stick if I then open the report. Can someone tell me which winspool function I use to send the report to the printer?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
MoonDoggie,
<this application is very locked down.>
You did not mention this in your original post.
<but then if the user cancels out of the dialog, I don't see a way to trigger the form to unhide. >
In my sample, the Report Prints, not the Form.
Are you saying that this was not the case when you tried it?
<After trying different methods I decided the best way would be to use the API to open the dialog >
There is a way around that without using API's, but if you have already decided on this, then there is no need to discuss it.
JeffCoachman
<this application is very locked down.>
You did not mention this in your original post.
<but then if the user cancels out of the dialog, I don't see a way to trigger the form to unhide. >
In my sample, the Report Prints, not the Form.
Are you saying that this was not the case when you tried it?
<After trying different methods I decided the best way would be to use the API to open the dialog >
There is a way around that without using API's, but if you have already decided on this, then there is no need to discuss it.
JeffCoachman
ASKER
My apologies. Your sample works. I already have the report open when the user clicks the button for print properties, therefore when I adapted your code I didn't try to open it again, but that is the very line that makes it work. It takes the focus off the pop-up form for the dialog box.
I was also surprised to see that with echo off the dialog appears. I would have thought that it would not.
Thanks for your help, Jeff.
Mike
I was also surprised to see that with echo off the dialog appears. I would have thought that it would not.
Thanks for your help, Jeff.
Mike
<I was also surprised to see that with echo off the dialog appears. I would have thought that it would not>
Me too, but I have used this technique many times and I am just greatfull that the dialog box does appear!
;-)
Jeff
Me too, but I have used this technique many times and I am just greatfull that the dialog box does appear!
;-)
Jeff
ASKER