Hi All,
I am new to Access and haven't used VB in over 15 yrs! I am trying to create automated emailing with the click of a button in Access. I had success with a previous database; however this one is giving me a headache. :banghead:
Option Compare Database
Option Explicit
Private Sub CleanUp()
' Clean up public object references.
Set outlookNamespace = Nothing
Set outlookApp = Nothing
End Sub
Private Sub Command29_Click()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Eml_Reminder_RecordSet")
With rs
If .EOF And .BOF Then '(No Records found for this query.)
MsgBox "There are no records from the query 'Eml_Reminder_RecordSet' "
Else
Do Until .EOF 'DO UNTIL END OF RECORDSET FILE
If Label72.Name = "X" Then
DoCmd.SendObject acSendNoObject, , , ![eml], , , "Access Eml", "Hello " & ![CompanyName] & ", We currently have...", False
.Edit
![EMl_Sent] = Now()
'.Update
.MoveNext
End If
Loop
End If
End With
'CLEAN UP MEMORY AT END
If Not rs Is Nothing Then
rs.Close
Set rs = Nothing
End If
End Sub
I appreciate any and all help with this!
Thanks,
Sleigh
Note: Since I am a new member, I cannot spell out the e m a i l word; therefore where there is eml know it is actually spelled out...
I am new to Access and haven't used VB in over 15 yrs! I am trying to create automated emailing with the click of a button in Access. I had success with a previous database; however this one is giving me a headache. :banghead:
Option Compare Database
Option Explicit
Private Sub CleanUp()
' Clean up public object references.
Set outlookNamespace = Nothing
Set outlookApp = Nothing
End Sub
Private Sub Command29_Click()
Dim rs As DAO.Recordset
Set rs = CurrentDb.OpenRecordset("Eml_Reminder_RecordSet")
With rs
If .EOF And .BOF Then '(No Records found for this query.)
MsgBox "There are no records from the query 'Eml_Reminder_RecordSet' "
Else
Do Until .EOF 'DO UNTIL END OF RECORDSET FILE
If Label72.Name = "X" Then
DoCmd.SendObject acSendNoObject, , , ![eml], , , "Access Eml", "Hello " & ![CompanyName] & ", We currently have...", False
.Edit
![EMl_Sent] = Now()
'.Update
.MoveNext
End If
Loop
End If
End With
'CLEAN UP MEMORY AT END
If Not rs Is Nothing Then
rs.Close
Set rs = Nothing
End If
End Sub
I appreciate any and all help with this!
Thanks,
Sleigh
Note: Since I am a new member, I cannot spell out the e m a i l word; therefore where there is eml know it is actually spelled out...