Connecting Tech Pros Worldwide Help | Site Map

Forms Control

  #1  
Old November 9th, 2007, 08:05 PM
David Grist
Guest
 
Posts: n/a
Problem Description:

I have a large form called Reports Menu that lists several reports that can
be viewed or printed. Printing works fine. When I click view, the report
opens behind the Reports Menu. I then have to minimize or close the reports
menu to see it.

Can someone help me with code to minimize the reports menu so I can view the
report and when I close the report, restore the reports menu to it's
original size. Here's a sample of the code I currently have.

Private Sub View_Students_by_Last_Click()
On Error GoTo Err_View_Students_by_Last_Click

Dim stDocName As String

stDocName = "Membership - All Students by Last Name"
DoCmd.OpenReport stDocName, acPreview

Exit_View_Students_by_Last_Click:
Exit Sub

Err_View_Students_by_Last_Click:
MsgBox Err.Description
Resume Exit_View_Students_by_Last_Click

End Sub


Thanks for your assistance!

- Dave


  #2  
Old November 9th, 2007, 09:05 PM
fredg
Guest
 
Posts: n/a

re: Forms Control


On Fri, 09 Nov 2007 19:59:23 GMT, David Grist wrote:
Quote:
Problem Description:
>
I have a large form called Reports Menu that lists several reports that can
be viewed or printed. Printing works fine. When I click view, the report
opens behind the Reports Menu. I then have to minimize or close the reports
menu to see it.
>
Can someone help me with code to minimize the reports menu so I can view the
report and when I close the report, restore the reports menu to it's
original size. Here's a sample of the code I currently have.
>
Private Sub View_Students_by_Last_Click()
On Error GoTo Err_View_Students_by_Last_Click
>
Dim stDocName As String
>
stDocName = "Membership - All Students by Last Name"
DoCmd.OpenReport stDocName, acPreview
>
Exit_View_Students_by_Last_Click:
Exit Sub
>
Err_View_Students_by_Last_Click:
MsgBox Err.Description
Resume Exit_View_Students_by_Last_Click
>
End Sub
>
Thanks for your assistance!
>
- Dave
There is nothing wrong with the code. I would suspect the form that
this code is on is opened acDialog or pop-up, in which case it is
always on top.

My work around would be to add a line of code to the command button
code to make this form not visible:

stDocName = "Membership - All Students by Last Name"
DoCmd.OpenReport stDocName, acPreview
Me.Visible = False


then make it visible again (or close it) in the Report's Close event.

Code the report's Close event:
Forms!FormName.Visible = true

or close the form if it's no longer needed:
DoCmd.Close acForm, "FormName"

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Embedded .net Windows Forms Control Security Issue gxl034000@utdallas.edu answers 0 September 13th, 2006 11:45 PM
Saving Windows Forms control properties at run-time? Özden Irmak answers 2 November 20th, 2005 09:20 AM
COM Interop messes with IE hosted windows forms control Dilip answers 3 November 19th, 2005 01:50 AM
Windows.Forms.Control as ActiveX in asp.net page shows as broken image Vincent Mouton answers 0 November 18th, 2005 10:08 AM
Creating Forms control using Activator KK answers 2 November 16th, 2005 01:23 PM