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

"Hiding" Form When Report Runs? 1

Status
Not open for further replies.

EdAROC

Programmer
Aug 27, 2002
93
US
Darn! I was doing so well, now I forgot how...

Have a form that gathers parameters for a report that will display on the screen. When the report runs the form remains displayed and on top, covering the report.

I would like the report to be on top when it is displayed. I'm thinking to keep the form visible so the user can go back to the form and rerun the report with different parameters.

How would I do this?

I think I need to let you know a couple of the properties of the form? Pop Up = Yes, Modal = Yes (But, you already knew this from my description).
 
Pop Up = No, Modal = No should allow the report to open on top.

Let them hate - so long as they fear... Lucius Accius
 
I think the best bet is to minimise the form and restore it after the report closes.
 
Appologies for jumping in on this one, but as seen on other threads this has been a pain in my side. I have a mainform, modal=yes, popup=yes, as I don't want users roaming around Access toolbars an wrecking the db. However I am using Access 2003, and in the reports properies I can set the report to be modal=yes popup=yes, and sure thing the report comes in front of my mainform. HOWEVER viewing the report in this way loses the report tools, ie print,save,save as etc, as this is part of Access. However I found if I right click the top of the report, I then get a dropdown with save, save as. However there is also edit, which allows users to edit the report which I don't want. If I could find a way to rightclick the report and just get the save, saveas, print functions my headache would be gone.

Hope this may be of help,and someone could solve it. I considered minimising my main form, but some clown will sure as eggs go travelling. Regards
 
ZOR, how about creating a shortcut menu bar for your report? Then you can decide what buttons you want on it. You right-click and then you're good to go.
 
I tried creating a custom toolbar having print/print preview however I could not get it to appear at the top of the page/form being a modal/popup form. Is that what you mean. Hope I don't get shouted at barging in on this thread, but it might help EDAroc. Thanks
 
Sounds like what I want is as straybullet suggests - No for both Modal and Popup.

Thanks.

BTW - Here is what I am attempting to achieve:
Background: Access is being used to generate reports using an ERP database. Currently I create a file for each report (or report set of the same basic report, different sorts and/or layouts).

1. Access opens and startup set to a form that will collect parameters for a report.

2. The person can enter the parameters and click the [Run Report] button, OR click the [Cancel] button (or [X]/close box) - and the file closes.

3. When the [Run Report] button is clicked, the report is generated and displayed on the screen (preview). The person may then (1) print the report, (2) be able to return to the form (scenario - run the report with different parameters), or (3) [X] / Close the file.

Note - Some day there 1 file for all the reports. When the employees start the file they enter a login ID which is used to determine what reports are available (from a table the admin manages). A form displays that lists the reports the person can run - i.e. a menu. I would like a bare minimum menubar and toolbar - about the only events on them would be to print and exit. Feed back is welcome.
 
I changed Modal and Popup values to "No".
Ran the form, which ran the report. (Preview/display)
Clicked on the form to bring it to the front. (This is what I want to have happen).
Changed the dates and clicked [Run Report]
Nothing happened. (The report window was still open.)

Closed the report and clicked [Run Report] and the report was generated.

Is this typical? Must an open report be closed? Are there techniques to (1) auto close an already open report when an attempt is made to run it again and/or (2) generate a 2nd window with the new report.

This learning is fun!!!
 
An open report is a "snapshot" of the information requested at the time it's run.
You'd need to close it before running again to get a different "snapshot"
you could have the button clicked check if the report is open and if so, select it and close it before re-running.

Let them hate - so long as they fear... Lucius Accius
 
Open the report and don't pass along any parameters.
Use your form to set the report filter and then FilterOn = True.
That way when you change your dates you can just apply another filter (to the open preview) to change the data of the report.

Hope this helps?
 
You can't believe how excited I am!!! :) (Then again, you've passed this way too, so you do know, ha, ha).

With all this help I've just taken my skills - and the product the end user uses - to a new level.

Added straybullet's technique to check and close the report. Browsed around Tek-Tips to handle the "...OpenReport... cancelled." error message. And then added coding to handle the NoData event - using Access 97 Developer's Handbook and postings on Tek-Tips.

(I have made a note and will explore jkl0's technique to better understand it).

The end user now has a much cleaner interface!

Thanks to all for your input, it's really appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top