Darrenc
Registered User.
- Local time
- Today, 06:06
- Joined
- Apr 30, 2004
- Messages
- 62
I've come across a problem with my database, I’ve tried everything I can think of, and I’m still no wiser as to what’s causing the crashes. I hope someone can shed some light on what the problem might be.
I've created a database that uses a switchboard to navigate through the various forms, the switchboard is loaded (using the start up options) most of the database objects are switched off (like display database window), apart from 'allow full menus' and 'allow default shortcut menus'.
This reason I’ve given you the above information is that the error only occurs when the database is loaded through the start up options.
If I open the database bypassing the start-up options this error doesn't occur.
Now to the error:
I have various forms that have a button that will attempt to send an e-mail, its set up that the email doesn't send automatically but allows the user to edit the email before sending.
When the e-mail is created using the code below, and the user decides to cancel sending the email by pressing the 'close' button on the email, the database will lock up.
The first error message I get is:
The sendobject action was cancelled
You used a method of the DoCmd object to carry out an action in visual basic, but then clicked cancelling a dialog box.
For example, you used the close method to close a changed form, then clicked cancel in the dialog box that asks if you want to save the changes you made to the form.
The second message is my error trapping for cancelling the email, and then after that the form loses focus and I can't do anything to the database. It's still running because I have a clock on my form that’s still ticking away.
The only way I can close my database is to 'ctrl alt del' and 'end task' it. When I do this I get another error message saying
You can't exit the database now
If you are running a visual basic module that is using OLE or DDE, you may need to interrupt the module
And then the database closes.
I've noticed the crash only occurs when the 'display database window' option is turned off.
When its on then my error trapping deals with the closing of the email.
I've tried various things with the code like DoCmd.CancelEvent, but nothing seems to make any difference.
Any help would be greatly appreciated.
I've created a database that uses a switchboard to navigate through the various forms, the switchboard is loaded (using the start up options) most of the database objects are switched off (like display database window), apart from 'allow full menus' and 'allow default shortcut menus'.
This reason I’ve given you the above information is that the error only occurs when the database is loaded through the start up options.
If I open the database bypassing the start-up options this error doesn't occur.
Now to the error:
I have various forms that have a button that will attempt to send an e-mail, its set up that the email doesn't send automatically but allows the user to edit the email before sending.
When the e-mail is created using the code below, and the user decides to cancel sending the email by pressing the 'close' button on the email, the database will lock up.
The first error message I get is:
The sendobject action was cancelled
You used a method of the DoCmd object to carry out an action in visual basic, but then clicked cancelling a dialog box.
For example, you used the close method to close a changed form, then clicked cancel in the dialog box that asks if you want to save the changes you made to the form.
The second message is my error trapping for cancelling the email, and then after that the form loses focus and I can't do anything to the database. It's still running because I have a clock on my form that’s still ticking away.
The only way I can close my database is to 'ctrl alt del' and 'end task' it. When I do this I get another error message saying
You can't exit the database now
If you are running a visual basic module that is using OLE or DDE, you may need to interrupt the module
And then the database closes.
I've noticed the crash only occurs when the 'display database window' option is turned off.
When its on then my error trapping deals with the closing of the email.
Code:
Private Sub MailCreditReport_Click()
On Error GoTo Err_MailCreditReport_Click
Dim stDocName As String
If Me.Dirty Then
DoCmd.RunCommand acCmdSaveRecord
Else
End If
stDocName = "rptCreditAuthorisation"
DoCmd.SendObject acReport, stDocName, acFormatRTF, , _
, , , , True, False
Exit Sub
Exit_MailCreditReport_Click:
Call ReportError
Exit Sub
Err_MailCreditReport_Click:
Select Case Err.Number
Case "2501"
MsgBox "User cancelled Sending E-mail(s). Please Resend", vbExclamation, "Sending Stopped"
Exit Sub
Case Else
Resume Exit_MailCreditReport_Click
End Select
End Sub
I've tried various things with the code like DoCmd.CancelEvent, but nothing seems to make any difference.
Any help would be greatly appreciated.