HELP!!Cant stop database window displaying

G

Guest

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
 
G

Guest

Barry:

With the information you are providing, I'm not sure I can offer much help.

However, take a look at the code behind your Cancel button. It almost
sounds like the Cancel button causes an untrapped error in your fax code.
What if you try, with the Cancel button, to kill the fax process, and close
the form back to the beginning of the fax generation process? The reason you
may not be trapping the errors, in your fax code is that Access views the
error as occurring from the Cancel button, and there is not a trap for it.

Good luck.

Sharkbyte
 

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

Similar Threads


Top