Connecting Tech Pros Worldwide Help | Site Map

Forms Control

 
LinkBack Thread Tools Search this Thread
  #1  
Old November 9th, 2007, 07:05 PM
David Grist
Guest
 
Posts: n/a
Default Forms Control

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, 08:05 PM
fredg
Guest
 
Posts: n/a
Default 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
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,840 network members.