Report is Opening Behind Switch Board

Jkittle

Registered User.
Local time
Today, 14:43
Joined
Sep 25, 2007
Messages
100
I have a report that is filtered by choosing a number from a combo box on a form then a command button opens the form and hides the form. But the report opens up behind the switch board.

Anybody have any idea why this particular report does this?

My comand button code is below:

Private Sub Open_Shift_Scrap_Report_Click()
On Error GoTo Err_Open_Shift_Scrap_Report_Click

Dim stDocName As String

stDocName = "R-Machine_Scrap_By_Shift"
DoCmd.OpenReport stDocName, acPreview, , "[ShiftCode]=" & Me.txtshiftcode
DoCmd.Close acForm, "F-Select_Shift_Code", acSaveNo

Exit_Open_Shift_Scrap_Report_Click:
Exit Sub

Err_Open_Shift_Scrap_Report_Click:
MsgBox err.Description
Resume Exit_Open_Shift_Scrap_Report_Click

End Sub
 
Your switchboard is set as PopUp which puts it on top. If you change the OpenForm to:
DoCmd.OpenReport stDocName, acPreview, , "[ShiftCode]=" & Me.txtshiftcode, acDialog
...then it should now be on top but the next line (.Close) will not execute until the Preview is closed.
 

Users who are viewing this thread

Back
Top Bottom