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

Form comes up behind other form

Status
Not open for further replies.
Jul 27, 2004
52
0
0
US
I have a master form with a command button that opens another form. When I click on the command button to open the other form it opens BEHIND the master form so I can't see it. How can I make it open in FRONT of the master form? Thanks
 
You can set the new forms "Pop up" property is set to yes. This will keep the form on top of all other forms.

Or

You can use the setFocus method in the code which opens the form.

Waud
 
I stated incorrectly, it is not a FORM that comes up, it is a REPORT which comes up in preview mode.
See my onclick below:
Private Sub CustomerMaintPrintForm_Click()
On Error GoTo Err_CustomerMaintPrintForm_Click

Dim stDocName As String

stDocName = "rpt_CustomerMaintWorksheet"
DoCmd.OpenReport stDocName, acPreview

Exit_CustomerMaintPrintForm_Click:
Exit Sub

Err_CustomerMaintPrintForm_Click:
MsgBox Err.Description
Resume Exit_CustomerMaintPrintForm_Click

End Sub
 
Yeah I know it's a pain in the backside
you need to play with the maximize and minimize

Cmd button event for form print preview

DoCmd.SelectObject acForm, me.name
DoCmd.Minimize
DoCmd.OpenReport "YourReportName", acViewPreview


Report close event

Forms(yourMainForm).SetFocus
DoCmd.Maximize

Savil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top