send objects locking up

rat_1965

New member
Local time
Today, 06:32
Joined
Jun 3, 2003
Messages
5
First off thanks to Travis for getting me as far as I have. Now to the problem at hand for your perusal. I have code that picks up the records from a table, looping to get everything in the text of an email message. It will send the first email but any further attempts do absolutely diddly. I can't use send objects to do anything unless I close and restart access. Anybody have any ideas? Thanks for your help. Here is the code that I am using:

Dim rst As New ADODB.Recordset
Dim cnn As New ADODB.Connection
Dim sSQL As String
Dim sMessage As String
Dim emessage As Long

emessage = DCount("[Cell]", "Memphis")

If emessage > 0 Then
Set cnn = CurrentProject.Connection
sSQL = "Select * From [Memphis]"
rst.Open sSQL, cnn, adOpenStatic, adLockReadOnly
rst.MoveFirst
sMessage = "Time " & rst.fields("date time stamp") & vbCrLf

Do While Not rst.EOF
sMessage = sMessage & "Site" & rst.fields("Cell") & vbCrLf
rst.MoveNext
Loop
docmd.sendobject acsendnoobject, , , "Me@mail.com", , , "report"
rst.Close
End If

Enjoy

Bob
 

Users who are viewing this thread

Back
Top Bottom