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

Keeping a form open 1

Status
Not open for further replies.

hsp7777

Programmer
Jan 11, 2005
67
US
Greetings,

I am using the following code to display a report when a command button on a popup form is pressed. What I have had to do, however, is add the line of code, "DoCmd.Close" to close the form (so that the report can be seen). Otherwise the form overlays the report. Does anyone know of a way to keep the form still open but yet have it displayed "behind" the report (once the button is pressed to display the report)? (By the way, this is a popup form that is not modal).

Code:
Private Sub cmdBankersAdvisory_Click()
Dim strReportName As String
strReportName = "Report1"
DoCmd.Close
DoCmd.OpenReport strReportName, acViewPreview
End Sub

Thanks in advance!
 
How About?
Code:
   Private Sub cmdBankersAdvisory_Click()
    Dim strReportName As String
    strReportName = "Report1"
    DoCmd.OpenReport strReportName, acViewPreview
    Me.SetFocus
    DoCmd.Minimize
End Sub

________________________________________
Zameer Abdulla
Visit Me
A child may not be able to lift too much.
But it can certainly hold a marriage together
 
I was trying to avoid minimizing the form, but that is an alternative. Thanks for the code.
 
Must the form remain visible? If not, you could set the form's Visible property to false when the report opens, then in the report's close event, make the form visible again.

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top