Closing form after full screen Print Preview (1 Viewer)

Kronix

Registered User.
Local time
Today, 11:40
Joined
Nov 2, 2017
Messages
102
I have a button on a form that opens a print preview of a table in a form datasheet. The forms will often be opened in full screen mode, which means the print preview will also be opened full screen. The problem is, print preview removes the X button for the form window that normally appears at the top right under the access X button. This means I cannot close the form window that has opened without closing Access. This appears to be a bug. Leaving print preview into normal datasheet view does not make the X appear. Clicking on an Access menu item will make it reappear, but that is a hassle and users will be running it in runtime mode, which means they won't be thinking to click any menus anyway.

Is there an event for when the form leaves print preview mode (since that is the only other button users will be clicking)? Then I could close the window when they leave print preview. I don't know if refreshing the form will make the buttons reappear.
 

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 05:40
Joined
Oct 17, 2012
Messages
3,276
So you have a form, which users tend to use maximized, which opens a table in print preview mode?

Oddly, in the version I have at work (A2007), the maximize, minimize, and X buttons all reappear after a second or two. They also reappear immediately if, as you noticed, the Access menu is opened, and also if I click on any cell in the table.

So your options would include:
  • Teaching the users to use CTRL-F4 to close the table (not precisely a great option)
  • Teaching the users to open and close the Access window (worse option)
  • Teaching them to click inside a cell in the table to make the buttons reappear (also a bad option)
  • Using XML to replace 'Close Print Preview' on the ribbon with commands to actually close the open item (really bad option, and not sure if it can be done)
  • If you have Access 2007 or earlier, the only other option I can suggest offhand would be to add DoCmd.Restore to the VBA for the button that opens the preview (to prevent it from opening maximized), along with DoCmd.Maximize on the Form.Activate event on the calling form. It's not particularly elegant, however, as the users will see all the resizing going on.
  • Access 2010 and later have macros available on table events, but IIRC, 'print preview' isn't one of the events you can trigger.
  • Another workaround would be to create a report with the data your users need, and have them start printing THAT instead. I'd recommend that anyway, as I *REALLY* dislike letting users anywhere near the tables themselves.
 

isladogs

MVP / VIP
Local time
Today, 10:40
Joined
Jan 14, 2017
Messages
18,258
The print preview ribbon should only be visible when displaying reports.
Not for forms as these aren't designed to be printed.

If your report is opened as a popup report the print preview ribbon isn't shown and it just has a x in the top right of the report title bar.

Does that make sense or am I missing the point?
 

Frothingslosh

Premier Pale Stale Ale
Local time
Today, 05:40
Joined
Oct 17, 2012
Messages
3,276
The problem - and I verified it myself - is that he's opening a table in print preview mode, and when he does, the minimize, maximize, restore, and close buttons you normally have in the top right when something is maximized go away. Then, when you press the 'Close Print Preview' button, the preview goes away, but the table remains showing and maximized, and the min/max/restore/close buttons STILL stay hidden unless the users open and close the Access button on the top left, so the users can't get back to the form they were working in.

At least, that is how it behaved for me in A2007 when I tested his issue this morning.

Edit: Example attached.
 

Attachments

  • MissingButtons.jpg
    MissingButtons.jpg
    99.7 KB · Views: 85
Last edited:

isladogs

MVP / VIP
Local time
Today, 10:40
Joined
Jan 14, 2017
Messages
18,258
Hi Frothy

I only saw your first reply after submitting mine & didn't go back to edit it

You're right - Exactly the same behaviour occurs in A2010.
Personally I can't think of any valid reason for ever opening a table in print preview mode
 

Users who are viewing this thread

Top Bottom