I get an error message when I click the setup button in the print dialog window. Does anyone know how to fix this?
I get an error message when I click the setup button in the print dialog window. Does anyone know how to fix this?
What is the exact error message?
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Either that or does anyone know vba code to give user some options when printing? Like portrait or landscape, print which pages, fit on one page, select which printer, etc... It would be nice for the user to have these options to change when printing a report.
Can you tell us the error message text or post a screen capture?
I had code that would automatically set duplexing depending on user default printer. However, it quit working when we upgraded to Windows 7 and Office 2010. So annoying.
I also have code to set the destination paper bin. That still works. https://www.accessforums.net/program...ode-27054.html
Bing: Access VBA printer object properties
http://www.everythingaccess.com/tuto...ection-Utility
http://programmersheaven.com/discuss...ter-properties
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Here is the message I get:
"This action can't be carried out while processing a form or report event.
A macro specified as the OnOpen, OnLoad, OnClose, OnFormat, OnRetreat, OnPage, or OnPrint property setting contains an invalid action for the property.
When you click OK, an Action Failed dialog box will display the name of the macro that failed and its arguments."
After I click OK, nothing happens. There is no Action Failed dialog box that pops up. I do not have any macros running that I am aware of either. I tried to do everything in VBA. The VBA command that I have behind the print button is:
On Error Resume Next
Docmd.Runcommand acCmdPrint
After clicking the print button that I created on the report, the print dialog window appears and this is where the setup button is that doesn't work. The report is in modal mode with the split form behind it. I have a close button that will close the report so the user can go back to the split form which is not in modal. I only have the report in modal so the user has to either print or close it in order to go back to other parts of the database. I don't want lingering report windows scattered. It may confuse the user. So I'm not sure if this is what's causing the error but I really need to get this figured out because I have posted about this problem a long time ago but was not able to find a solution.
I should also mention that no matter what I do, I was NEVER able to get the setup button to work in the print dialog window. I've tried many things. I even tried creating a database from scratch just to test the print setup button and I would still get the same error message. So there must be something I am doing wrong because I'm sure the print setup is supposed to work and this is not just a bug. It's been happening to me since I been using 2007 Office all through 2013. Please help me figure this problem out. It's driving me crazy.
Now that you mention it, this does sound familiar. Is this the other thread https://www.accessforums.net/forms/a...orm-42195.html
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes that is the thread. How do you find old threads like that?
I just went through the whole thing and tried out what Trevor40 posted with the sample db in .mdb format and it works. However, what I am so sad about is the fact that it does not have the option to fit to one page option. That was the main reason I wanted to have the page setup work. I need to occasionally have my reports or whatever I print in Access to fit to a single page. Do you know how to get that option? sometimes it prints on a second page and only uses a fraction of the page so its wasting paper.
Thanks for the help June7. I hope you never leave this forum. You and the other gurus have always been most helpful.
I just searched the forum for threads you started.
Why would the report stretch to a second page - more records or margins too narrow?
Access does not have 'fit to page'. Have to format and arrange elements so all fit on one page. If the report is to output multiple records and the number of records varies, the report length will vary.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
Yes I do like the margins narrow because I want to utilize the space and much as possible. So what you are saying is that the only way is to trial and error on sizing the report in design view till I get it to fit to one page? Oh and when I said fit to one page, I mean horizontal. I understand that vertical will vary since my reports have different amounts of records all the time. So going down the page is fine. It's across that sometimes its to long and gets cut off and the rest goes onto a second page. This is what's annoying me.
Yes. Try larger margin.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.