C
Charles Harmon
My application starts with the ShowStartupDBWindow
property FALSE. When printing forms from a print forms
menu in the program the Database Window appears and
doesn't go away. Is there anyway I can prevent this from
happening or a way, in code, to close the database window
so the users don't accidentally close it by mistake and
end the application?
I am using Access 2000 on Win 98 OS.
The code to print the forms is:
Private Sub cmdApprovals_Click()
On Error GoTo Err_cmdApprovals_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "frmApproval"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.name, False
Exit_cmdApprovals_Click:
Exit Sub
Err_cmdApprovals_Click:
sHdr = "frmPrint: cmdApprovals_Click"
MsgBox Err.Number & ": " & Err.Description, , sHdr
Resume Exit_cmdApprovals_Click
End Sub
I believe the Screen.ActiveForm is causing the database
window to appear.
I have tried variations of this code to eliminate the
Screen.ActiveForm, but I always get the "Printout
Canceled" error message when I do.
Any help appreciated. Thanks
Chuck Harmon
property FALSE. When printing forms from a print forms
menu in the program the Database Window appears and
doesn't go away. Is there anyway I can prevent this from
happening or a way, in code, to close the database window
so the users don't accidentally close it by mistake and
end the application?
I am using Access 2000 on Win 98 OS.
The code to print the forms is:
Private Sub cmdApprovals_Click()
On Error GoTo Err_cmdApprovals_Click
Dim stDocName As String
Dim MyForm As Form
stDocName = "frmApproval"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.name, False
Exit_cmdApprovals_Click:
Exit Sub
Err_cmdApprovals_Click:
sHdr = "frmPrint: cmdApprovals_Click"
MsgBox Err.Number & ": " & Err.Description, , sHdr
Resume Exit_cmdApprovals_Click
End Sub
I believe the Screen.ActiveForm is causing the database
window to appear.
I have tried variations of this code to eliminate the
Screen.ActiveForm, but I always get the "Printout
Canceled" error message when I do.
Any help appreciated. Thanks
Chuck Harmon