I'm using the following code on a button to automatically print off a report and some other forms. When the user is finished the main database window is open(when it should remain hidden and is set to "hidden" using the startup options). Is there any way to keep the database window to remain hidden?
Private Sub Command158_Click()
On Error GoTo Err_Command158_Click
Dim stDocName1 As String
stDocName1 = "PAY FINAL INVITATION REPORT COST ANALYSIS"
DoCmd.OpenReport stDocName1, acNormal
Dim stDocName2 As String
Dim MyForm2 As Form
stDocName2 = "frmform2"
Set MyForm2 = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName2, True
DoCmd.SelectObject acForm, MyForm2.Name, False