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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing maximized preview closes Access

Status
Not open for further replies.

jjefferson

Technical User
Oct 8, 2001
98
US
I'm asking this for a colleague, so forgive me if I haven't provided enough information; I'll supply more if needed.

The basic problem is that a report is presented in print preview mode, and the user clicks the maximize button on the preview's frame. All toolbars are disabled for the end users, so there is no "Close" to click that would normally be there on the toolbar. Clicking the only available "X" button is on the upper-right and shuts down Access completely.

We're looking for a way to allow the user to expand the preview to the fullest size possible, but then be able to close that preview and view the form from which the preview was generated.

Thanks for any advice, or let me know if other information is needed to assess the situation.

Jim
 
In the Print preview of the report do you have the toolbar ticked in View/Toolbars/Print Preview

Hope this helps
Hymn
 
Hymn:

I didn't think I had properly/completely described what we're doing. Hope this helps further.

We have a form that sort of displays the information that is going to appear on the report, so the user can scroll through it and see if the criteria (entered on an earlier form) got the general results he was looking for. I think this is shown in just a big listbox.

At the bottom of the form are a "Print" button, which prints the actual report, and a "Print Preview" button, which does the DoCmd.OpenReport "Reportname", acViewPreview.

The preview displays just fine. However, if the user then clicks the Maximize button on the preview, it expands to fill the whole screen and seems to lose it's own min/max/close button set. Clicking the close button on the upper right closes Access entirely and not just the preview.

Hope that gets a little closer to illustrating the problem. Thanks for your help.

Jim
 
Follow-up: Research through these forums suggests that maybe what we want to do is set up an on close event for Access (where would we do that?), which examines a collection to see if a form or report is open, and if so cancel the close of Access and close the preview programatically.

Does this sound like a good approach? If so, any hints on where to put the event code when the MDB is being closed?

Thanks again,
Jim
 
Again
In the Print preview of the report do you have the toolbar ticked in View/Toolbars/Print Preview ???????
this will give you a way of closing the report
You must have some code or the properties are set so that the min/max and close are not displayed

Hope this helps
Hymn
 
Don't know if this works, but you can create a button, and simply put the docmd.close action on the button.

That shouldn't close the application.

 
Hymn: Yes, when we do what you suggest we have the "close" button on the toolbar. But we also have all the other buttons ("design", etc.) that we want to suppress. The user requirements are that ALL menus and toolbars need to be suppressed, except for the min/max/close controlbox. Maybe we need to customize this toolbar to remove everything but "close"? Is that possible? Any gotchas for doing that?

Today we found a reference on Microsoft's knowledgebase that seems to apply to this situation (disappearing controlbox when maximizing), and they show it as an unresolved bug as of 7/16/2004. So it appears we will have to find some sort of workaround.

Simon: We didn't think you could place controls (command button) on a report. Is there some trick you know that allows this? That would solve our problem a lot easier that what we're looking at. Thanks for any info.

I appreciate the feedback and suggestions. It may be that we have to wait for an SR to Office, but if any other ideas come to mind we'd like to try them.

Jim
 
What version?

In 2002+ versions, you can open reports in dialog mode, where the only "x" button closes the report, and only the report. Syntax:

[tt]docmd.openreport, "myrpt",acviewpreview,,,acdialog[/tt]

Using this, I'd recommend using docmd.maximize in the reports on open event.

Else, you could always stress the usage of ESC or ALT+C ;-)

Roy-Vidar
 
Roy: It's Access 2000, so we don't have the acdialog argument (alas).

Since an upgrade isn't in the stars at the moment, I think we're going to end up with some logic in the on close event that checks a collection to see what is open, to try and trap this situation and cancel the close.

Thanks for everyone's help!

Jim
 
Why not create your own toolbar/menubar with only the options (such as Close) you want the user to have?

Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top