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

Hiding the Access Window - faq705-2562

Status
Not open for further replies.

load3d

Programmer
Feb 27, 2008
117
US
I stumbled upon faq705-2562 and I set it up on my database. It really works great. Except when I try to close a report it doesn't just hide the access window, it hides everything and I have to go into task manager and end the process and then restart access (lol). SO, to fix that I just took out the restore macro so if any of the users run a report they will have the access window again. But, it looks really nice without that horrible grey background so I was wondering if anyone had some input on how to fix that?

I'm using Access 2007
 
Are you sure you have all your forms set to Popup? How are you opening the report (what code is being used)? What happens in your code after the report is closed?

I haven't used this in Access 2007 before, but it should work the same. I expect that you are opening your report, hiding or closing the form you call the report from, and are not making that form visible again either by the visible property or by reopening the form. You also need to ensure the last step (the OnOpen and OnClose for the reports) is done for EVERY report in your application. If you miss even one, the Access window will not be hidden or shown as it should.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
I've been trying to get this one report to work. Once I get it to work then the rest will work. Yes, all of my forms are set to pop up. I think the report is now set to pop up during on of my tests.

The code that i'm using in the onclick event is:

DoCmd.OpenReport "rpt_batteriesoutforservice", acViewPreview, , , acWindowNormal


The OnOpen and OnClose macros are also set.

I know I copied the code correctly because the restore macro works when I open the report and the hide macro works when I open the program. However, it doesn't work when I close any reports.

 
Have you set a breakpoint to check that the event fires?
 
The close event? Yes, it's definately running. It's just hiding not only the accesss window but it's hiding my main form as well.

 
hmmm...I did not catch this before...but try this:

Remove the acWindowNormal from your report call.

You should be using:

Code:
DoCmd.OpenReport "rpt_batteriesoutforservice", acViewPreview

I think that is the trouble. Let me know.

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Well, I am out of ideas at this point. Don't normally suggest going off line, but if you want to send a copy of the db to me I'd be happy to take a look. You can post it up to some share site and let me know where it is, I'll grab it and let you know my findings. If that's not an option, I can give you my addy. I will also post my results here for everyone else to see...

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Thanks for your help. I gave up on it yesterday because it wasn't really a high priority thing but I had some ideas this morning. All I ended up doing was

docmd.runmacro "mcrhide"

forms!mainform.visible = true (it was actually setting my mainform invisible)


However, I also needed to take the acwindownormal off of the openreport command. Thanks again.

 
Glad you got it..... [smile]

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB.NET Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top