I am attemping to email multiple individuals using vba code. I'm almost there. But when I run the code, I recieve the following message: "No value given for one or more required parameters"

I have two fields in frmAttendanceSearchView

1) Type of conference = string

2) Times attended = is denoted as a "count function" in qryAttendance

How do I match my "types" so I do not recieve this error???


Here's what i have so far:


Private Sub Command14_Click()
On Error GoTo Err_Command14_Click
Dim SendString As String
Dim strSQL As String
Dim rstAttendance As New ADODB.Recordset



strSQL = "SELECT * FROM " & "qryAttendance " _
& "WHERE (type_of_conference=" & Forms!frmAttendanceSearchView.[Type of Conference] & " And times_attended = " & Forms!frmAttendanceSearchView.[Times Attended] & ");"


'Open the Recordset to Customers
rstAttendance.ActiveConnection = Application.CurrentProject.Connection
rstAttendance.CursorType = adOpenKeyset
rstAttendance.Open strSQL


SendString = ""

If MsgBox("Send Email" & Chr(13) & _
"to all Contacts using Microsoft Outlook?", 4) = 6 Then

With rstAttendance


Do Until .EOF
' Create the Invoice report Filter used by the Report_Open
' event.

SendString = SendString & !PersonalEmail & ";"
.MoveNext
Loop

SendString = Left$(SendString, Len(SendString) - 2)


DoCmd.SendObject , "", "", [SendString], "", "", "", "", True, ""

End With
End If

rstAttendance.Close

Exit_Command14_Click:
Exit Sub

Err_Command14_Click:
MsgBox Err.Description
Resume Exit_Command14_Click

End Sub
---------------------------
Microsoft Access
---------------------------
No value given for one or more required parameters.
---------------------------
OK
---------------------------