Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / February 2005

Tip: Looking for answers? Try searching our database.

SendObject in Access2K works sporadically

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sam - 11 Feb 2005 21:43 GMT
The db I use has code (below) to send an email to an individual, based
on the completion of an action with the record. This many happen for
one record at a time, or 25 records at a time, some sequential, some
not.

Problem is it only works sometimes. Generally, if I try to use it on a
second record in a series, it LOOKS like it is working (the status bar
in the lower left says "calculating..." then returns to form view), but
does not actually DO the process. But sometimes it works flawlessly for
any number of record updates, and then stops working with no indication
of a problem. And there is no telling when it will work and when it
won't. It doesn't throw a debug at me and I have to close the db to be
able to get it to work.

I am not SQL savvy enough to figure what is or isn't working. Any
ideas?

Thanx,
Sam

CODE
Private Sub chkspvsr_Click()
On Error GoTo Err_chkspvsr_Click

Dim CHK As Integer
Dim BNum As Variant
Dim Client As String
Dim email As String
Dim DScrip As Variant

DScrip = Me!Descr
BNum = Me!txtBCRNum
Client = Me!txtClientName
CHK = Me!chkspvsr

If CHK = -1 Then
   Me!lblMsg.Visible = True

   DoCmd.SendObject , , acFormatTXT, "User.Name@Company.com", , , "BCR
# '" & _
   BNum & "' for '" & Client & "' is TESTED and COMPLETE.",
"DESCRIPTION OF CHANGE - " & DScrip
   Me!lblMsg.Visible = False
Else: Exit Sub
End If

Exit_chkspvsr_Click:
   Exit Sub

Err_chkspvsr_Click:
   Me!lblMsg.Visible = False
   MsgBox Err.Description
   Resume Exit_chkspvsr_Click
End Sub
pietlinden@hotmail.com - 12 Feb 2005 04:28 GMT
So you change the Sub to a Function and make the return value a
Boolean.  At the top of the function, you declare the default value to
false.  If the mail sends, you set it to true.  In the error trapping,
you set it to false.  Then if the function returns False, you do
something - flag the record, write the failure to a table, whatever.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.