DwayneS
Instructor
- Mar 29, 2002
- 70
Novice user of vb with Access. I'm trying to send a seperate e-mail to each of a few dozen people I can find easily with a simple select query.
I've read through all kinds of suggestions on this board and tried lots of your code, but mine still won't run.
Someone PLEASE look at this and tell me what I'm doing wrong.
I really appreciate you guys. Usually I fix whatever I need to do by just watching and copying code. This time I can't
Here's what I'm trying to get running:
Private Sub MailGroup_Click()
' I'm trying to hard-wire a broadcast e-mail to this query for now ...
' Later I can do more by feeding parameters to the query.
' eMailGroup is a very simple select query
' With one of its fields being email
Dim dbs As Database
Dim rs As Recordset
Dim subject As String
Dim message As String
Set dbs = CurrentDb
subject = "Test"
message = "This is only a test"
' The following line of code always fails with
' "Run-time error '13' Type mismatch"
Set rs = CurrentDb.OpenRecordset("eMailGroup"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
With rs
Do While Not .EOF
DoCmd.SendObject acSendNoObject, , , , , , subject, message, False
.MoveNext
Loop
End With
' Is this done right to send individual e-mails to every record from the query?
End Sub
I've read through all kinds of suggestions on this board and tried lots of your code, but mine still won't run.
Someone PLEASE look at this and tell me what I'm doing wrong.
I really appreciate you guys. Usually I fix whatever I need to do by just watching and copying code. This time I can't
Here's what I'm trying to get running:
Private Sub MailGroup_Click()
' I'm trying to hard-wire a broadcast e-mail to this query for now ...
' Later I can do more by feeding parameters to the query.
' eMailGroup is a very simple select query
' With one of its fields being email
Dim dbs As Database
Dim rs As Recordset
Dim subject As String
Dim message As String
Set dbs = CurrentDb
subject = "Test"
message = "This is only a test"
' The following line of code always fails with
' "Run-time error '13' Type mismatch"
Set rs = CurrentDb.OpenRecordset("eMailGroup"
With rs
Do While Not .EOF
DoCmd.SendObject acSendNoObject, , , , , , subject, message, False
.MoveNext
Loop
End With
' Is this done right to send individual e-mails to every record from the query?
End Sub