database window not staying hidden

bpaquette

Registered User.
Local time
Today, 12:02
Joined
Aug 13, 2003
Messages
119
so i have a button on my switchboard that prints a report... the problem is that when it's clicked, the database window -- which should be hidden! -- is revealed.


the code is (it's just slightly modified wizard code):

Code:
Private Sub cmdPrintAlphaRoster_Click()
On Error GoTo Err_cmdPrintAlphaRoster_Click

    Dim stDocName As String
    Dim MyForm As Form




    stDocName = "rptAlphaRoster"
    Set MyForm = Screen.ActiveForm
    DoCmd.SelectObject acReport, stDocName, True
DoCmd.PrintOut
    DoCmd.SelectObject acForm, MyForm.Name, False

Exit_cmdPrintAlphaRoster_Click:
    Exit Sub

Err_cmdPrintAlphaRoster_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrintAlphaRoster_Click
    
End Sub
 

Users who are viewing this thread

Back
Top Bottom