Bringing report preview to top. 
Author Message
 Bringing report preview to top.

You can hide the Main Form within the event that opens the report, then make
it visible within the Close event of the report.
--
Doug
Reply to is anti-spammed remove the "z" from email

Quote:
>Here is my situation:

>I have an app which is based in a single window.  Some functions,
>including report filtering, are done in pop-up windows.  When a report
>preview is opened from the main form or a menu, it comes up on top,
>where we like it.  When a report is opened from a pop-up, the onClick
>code behind the preview button brings up the report then closes the pop-
>up, thereby pulling the main window to the front, hiding the report.

>There isn't much I can do with the pop-up, as it won't execute any code
>after the close command is called.  I have been trying to make the
>report act in a modal fashion, but I haven't had much luck.  I thought
>about simu;lating a report preview in a form, but I only have one
>lifetime to give to this project <g>.

>Any thoughts on this?





Mon, 19 Nov 2001 03:00:00 GMT  
 Bringing report preview to top.
Here is my situation:

I have an app which is based in a single window.  Some functions,
including report filtering, are done in pop-up windows.  When a report
preview is opened from the main form or a menu, it comes up on top,
where we like it.  When a report is opened from a pop-up, the onClick
code behind the preview button brings up the report then closes the pop-
up, thereby pulling the main window to the front, hiding the report.

There isn't much I can do with the pop-up, as it won't execute any code
after the close command is called.  I have been trying to make the
report act in a modal fashion, but I haven't had much luck.  I thought
about simu;lating a report preview in a form, but I only have one
lifetime to give to this project <g>.

Any thoughts on this?


TIA

Cary Gordon

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Tue, 20 Nov 2001 03:00:00 GMT  
 Bringing report preview to top.
Here is my situation:

I have an app which is based in a single window.  Some functions,
including report filtering, are done in pop-up windows.  When a report
preview is opened from the main form or a menu, it comes up on top,
where we like it.  When a report is opened from a pop-up, the onClick
code behind the preview button brings up the report then closes the pop-
up, thereby pulling the main window to the front, hiding the report.

There isn't much I can do with the pop-up, as it won't execute any code
after the close command is called.  I have been trying to make the
report act in a modal fashion, but I haven't had much luck.  I thought
about simu;lating a report preview in a form, but I only have one
lifetime to give to this project <g>.

Any thoughts on this?


TIA

Cary Gordon

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Tue, 20 Nov 2001 03:00:00 GMT  
 Bringing report preview to top.
Cary,

You will have to remember the name of your report, close the window and make
the report window the top window. Here ist the code we use, which is
executed from a subform in the print pop-up form

EndFunction:

    DoCmd.Close acForm, Me.Parent.Name

    ' bring report to front
    ' showreport holds the name of the report
    ' Druckmodus is the German translation for Printmode and tells
    ' if the user wants to print or preview the report

    If Druckmodus = acViewPreview And Not Showreport = "" Then
        DoCmd.SelectObject acReport, Showreport
    End If

    Exit Function



Quote:
> Here is my situation:

> I have an app which is based in a single window.  Some functions,
> including report filtering, are done in pop-up windows.  When a report
> preview is opened from the main form or a menu, it comes up on top,
> where we like it.  When a report is opened from a pop-up, the onClick
> code behind the preview button brings up the report then closes the pop-
> up, thereby pulling the main window to the front, hiding the report.

> There isn't much I can do with the pop-up, as it won't execute any code
> after the close command is called.  I have been trying to make the
> report act in a modal fashion, but I haven't had much luck.  I thought
> about simu;lating a report preview in a form, but I only have one
> lifetime to give to this project <g>.

> Any thoughts on this?


> TIA

> Cary Gordon

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



Tue, 20 Nov 2001 03:00:00 GMT  
 Bringing report preview to top.

Better is to Hide the Popup Form before it opens The Report
i.e

Sub btnPrintIt()
  On Error Resume Next ' Or implement err Handling
  '...
  Me.Visible = False
  DoCmd.OpenReport Me!ReportName,AcViewPreview, WhereCondition := ...
  If Err.Number <> 0 Then
    Me.Visible = True
    '... Handle Error
  Else
   DoCmd.Close acForm , Me.Name
  End If
End Sub  

--
Regards
Pieter Wijnen


http://www.thuleeng.com

Tough guys don't take backup - tough guys cry a lot..

Good site to look for Access answers is:
http://home.att.net/~dashish

  wijnen.vcf
< 1K Download


Tue, 20 Nov 2001 03:00:00 GMT  
 Bringing report preview to top.
Thanks to everyone who responded!

After a lot of experimentation, I found that the method with the fewest
undesirable side effects (like resizing the Access app window or
interfering with other code) was to attach "forms!TheMainForm.Visible =
False" to the "Report_Activate" event and "forms!TheMainForm.Visible =
True" to the "Report_Close" event of each report.


Quote:

> Here is my situation:

> I have an app which is based in a single window.  Some functions,
> including report filtering, are done in pop-up windows.  When a report
> preview is opened from the main form or a menu, it comes up on top,
> where we like it.  When a report is opened from a pop-up, the onClick
> code behind the preview button brings up the report then closes the
pop-
> up, thereby pulling the main window to the front, hiding the report.

> There isn't much I can do with the pop-up, as it won't execute any
code
> after the close command is called.  I have been trying to make the
> report act in a modal fashion, but I haven't had much luck.  I thought
> about simu;lating a report preview in a form, but I only have one
> lifetime to give to this project <g>.

> Any thoughts on this?


> TIA

> Cary Gordon

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


Wed, 21 Nov 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. command to bring cursor to the top of the word doc

2. Bring App to top

3. How to bring the previous application on top?

4. VB6 Form In Modal Mode Brings IDE To Top

5. VB6 and Forms and MessBox focus (Bring to top)

6. Bringing a window to the top

7. GSG?9: Bring MDI Form on top

8. Bring another applications main window to the top?

9. Bringing window to top problem

10. Bring window "always on top"?

11. How to bring to the top?

12. What brings a form to top?

 

 
Powered by phpBB® Forum Software