Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Freezez have moved this thred from forms to coding

Status
Not open for further replies.

Costefran

Technical User
Jan 2, 2008
197
GB
Hello

sorry to confuse matters but have moved this question from the forms forum as after further investigation on the other sites it looks like its a code problem

I have used the code suggested and still have problems. That is when I cancel my email I my DB freezes and the only thing I can do is to close via the task manager

When I close the email without sending I get this message

"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."

and after closing via the task manager I get the following message

"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"

My code, as previously suggested, is as follows

Private Sub EMAIL_VENDOR_AUTHORISATIONS_REQUIRED_Click()
On Error GoTo Err_EMAIL_VENDOR_AUTHORISATIONS_REQUIRED_Click


DoCmd.SendObject acReport, "Pending All Vendor Authorisations", "SnapshotFormat(*.snp)", "", "", "", "Approvals Required", "Please note there are a number of Approvals now required", True, ""


Exit_EMAIL_VENDOR_AUTHORISATIONS_REQUIRED_Click:
Exit Sub

Err_EMAIL_VENDOR_AUTHORISATIONS_REQUIRED_Click:
Select Case Err.Number
Case 2501
Resume Next
Case Else
MsgBox "Err " & Err.Number & ": " & Err.Description

End Select

Resume Exit_EMAIL_VENDOR_AUTHORISATIONS_REQUIRED_Click

End Sub
 
How are ya Costefran . . .

Parsing over the arguements I see there's no [blue]to[/blue], [blue]cc[/blue], or [blue]bcc[/blue][/i][/b][/blue] provided.

Hows your email software to know [purple]where to send?[/purple]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
There isn't as I've left it free for the user to type in email addresses as they see fit

Would this make a difference


 
Costefran . . .

You set the arguement proper for viewing in your client. Try and address in to: for test purposes . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
In you Error catch, try using this for the Case 2501

Resume Exit_EMAIL_VENDOR_AUTHORISATIONS_REQUIRED_Click

instead of the Resume Next.

Since you have no other code to continue with, this should force the sub to exit gracefully....

=======================================
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. (Calvin from Calvin And Hobbs)

Robert L. Johnson III
CCNA, CCDA, MCSA, CNA, Net+, A+, CHDP
VB/Access Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top