Hello,
I've been playing with this for ages without success. I have three tables (part of a database which is used to track responses from various divisions) with the following fields:
tblPerson
> pkPersonID
> txtFirstName
> txtLastName
> txtEmail
tblDivision
> pkDivID
> txtDivisionName
> txtLastResponse (** Date last response received from Division)
tblDivisionPerson
> pkDivPersonID
> fkDivID
> fkPersonID
I have a query which i run, which says, gives me all the division in where the last response is based on an input paramater (i.e.// give all divisions where the lastresponse was before Jan 1, 2010). On this form, when i run this query, i want a command button that when i click it, it would open up an email message with the email of all divisions who meet the above criteria (according to who the person linked to that division is). I'm sure there is a simple way to do this and i'm missing it.
I tried this code, but no luck:
When i run the above i get a "Run-time error 2295: Unknown message recipients(s); the message was not sent.
Any advice? This recordset is totally new to me..so i've been trying to figure it out.
Andrew.
I've been playing with this for ages without success. I have three tables (part of a database which is used to track responses from various divisions) with the following fields:
tblPerson
> pkPersonID
> txtFirstName
> txtLastName
> txtEmail
tblDivision
> pkDivID
> txtDivisionName
> txtLastResponse (** Date last response received from Division)
tblDivisionPerson
> pkDivPersonID
> fkDivID
> fkPersonID
I have a query which i run, which says, gives me all the division in where the last response is based on an input paramater (i.e.// give all divisions where the lastresponse was before Jan 1, 2010). On this form, when i run this query, i want a command button that when i click it, it would open up an email message with the email of all divisions who meet the above criteria (according to who the person linked to that division is). I'm sure there is a simple way to do this and i'm missing it.
I tried this code, but no luck:
Code:
Private Sub cmdEmail_Click()
Dim strMailList As String, rs As Recordset
Set rs = CurrentDb.OpenRecordset("tblPerson", dbOpenDynaset)
With rs
.MoveFirst
Do
strMailList = strMailList & !txtEmail & ";"
.MoveNext
Loop Until .EOF
strMailList = Left(strMailList, Len(strMailList) - 1)
.Close
End With
DoCmd.SendObject acSendForm, "frmMissingResponses", acFormatHTML, strMailList, , , "Missing Scorecard Response", "Test", True
Set rs = Nothing
End Sub
When i run the above i get a "Run-time error 2295: Unknown message recipients(s); the message was not sent.
Any advice? This recordset is totally new to me..so i've been trying to figure it out.
Andrew.