Database window displays when cancelling the fax dialog box

B

Barry

The program i have created is used to create a fax and store the details in
the table. I am using the fax machine provided in the print dialog box that
can be used to send a fax from all microsoft programs but if the user presses
the cancel button on the fax dialog window before sending the fax it allows
the user access to the database window.

the code i am using on the send fax comand button is:

Private Sub cmdSendFax_Click()
On Error GoTo Err_cmdSendFax_Click

Dim stDocName As String
Dim MyForm As Form

stDocName = "FAX"
Set MyForm = Screen.ActiveForm
DoCmd.SelectObject acForm, stDocName, True
DoCmd.PrintOut
DoCmd.SelectObject acForm, MyForm.NAME, False
DoCmd.Close

Exit_cmdSendFax_Click:
Exit Sub

Err_cmdSendFax_Click:
MsgBox Err.Description
Resume Exit_cmdSendFax_Click

End Sub

Has anyone come accross this problem before or can anyone please send me a
fix for this becuase this problem could cause major data loss if users have
access to tables and forms
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top