ckennerdale
Programmer
I am sending an email directly from a form.
So far I have been able to extractall email address from a database and send.
What I want to do is allocate a particular distribution list to each record in the database, and then select hich list to send to via a pull down form.
However I get the message 'Parameter missing, Expected 2' when I execute my code - which seems to be on the SQL statement. I am not sure what this error means so it is difficult to double check.
Here is the code
strSQL = "SELECT * FROM Distribution_Contacts WHERE Distribution_Contacts.[Distribution_List] = Me!DistributionList"
Set rs = dbs.OpenRecordset(strSQL)
Do Until rs.EOF
If Len(MyEmails) = 0 Then
MyEmails = rs! & rs![Distribution_List] & Me!DistributionList
Else
MyEmails = MyEmails & ";" & rs![Email] & rs![Distribution_List] & Me!DistributionList
End If
rs.MoveNext
Loop
(Distribution_Contacts = Database
[Distribution_List] = Field containing which list they belong to]
Me!DistributionList = drop down filed in form)
Any ideas on what the error is if it is a syntax error or what the sql error means?
Thanks
Caspar Kennerdale
So far I have been able to extractall email address from a database and send.
What I want to do is allocate a particular distribution list to each record in the database, and then select hich list to send to via a pull down form.
However I get the message 'Parameter missing, Expected 2' when I execute my code - which seems to be on the SQL statement. I am not sure what this error means so it is difficult to double check.
Here is the code
strSQL = "SELECT * FROM Distribution_Contacts WHERE Distribution_Contacts.[Distribution_List] = Me!DistributionList"
Set rs = dbs.OpenRecordset(strSQL)
Do Until rs.EOF
If Len(MyEmails) = 0 Then
MyEmails = rs! & rs![Distribution_List] & Me!DistributionList
Else
MyEmails = MyEmails & ";" & rs![Email] & rs![Distribution_List] & Me!DistributionList
End If
rs.MoveNext
Loop
(Distribution_Contacts = Database
[Distribution_List] = Field containing which list they belong to]
Me!DistributionList = drop down filed in form)
Any ideas on what the error is if it is a syntax error or what the sql error means?
Thanks
Caspar Kennerdale