Where do you should the acDialog go? I tried a couple time and I get an error.
Everything works, its just the silly report opens behind the switchboard and then I have to minimize the switchboard to get the report. The people on the floor think the report didn't run.
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