C
Confused
I have this Function to run on a query called "EmailQuery" . This code opens
my email and populates all of the names in the BCC field. Now when I click
the Cmd button I get a Run-Time Error with the message 'Too Few Parameters.
Expected 1.' The line it highlights in the code below is Set RS =
DBEngine(0)(0).OpenRecordset(sSQL)
I added a subquery to the SQL to filter the form EmailQuery when it opens
to this query, but I didn't do anything to the code below ( not sure if this
is related to the problem).
Private Sub Command14_Click()
DoCmd.SendObject acSendNoObject, , , , , EmailonQ1, "Subject", "Message",
True, False
End Sub
Public Function EmailonQ1()
Dim RS As DAO.Recordset
Dim tmpEM As String
Dim sSQL As String
sSQL = "SELECT emailquery.emailaddress " & _
"FROM emailquery where [send to?] = -1 ;"
Set RS = DBEngine(0)(0).OpenRecordset(sSQL)
RS.MoveFirst
Do While Not RS.EOF
tmpEM = tmpEM & Nz(RS.Fields(0).Value, "") & ";"
RS.MoveNext
Loop
EmailonQ = tmpEM
Set RS = Nothing
End Function
Much appreciate any help resolving...
my email and populates all of the names in the BCC field. Now when I click
the Cmd button I get a Run-Time Error with the message 'Too Few Parameters.
Expected 1.' The line it highlights in the code below is Set RS =
DBEngine(0)(0).OpenRecordset(sSQL)
I added a subquery to the SQL to filter the form EmailQuery when it opens
to this query, but I didn't do anything to the code below ( not sure if this
is related to the problem).
Private Sub Command14_Click()
DoCmd.SendObject acSendNoObject, , , , , EmailonQ1, "Subject", "Message",
True, False
End Sub
Public Function EmailonQ1()
Dim RS As DAO.Recordset
Dim tmpEM As String
Dim sSQL As String
sSQL = "SELECT emailquery.emailaddress " & _
"FROM emailquery where [send to?] = -1 ;"
Set RS = DBEngine(0)(0).OpenRecordset(sSQL)
RS.MoveFirst
Do While Not RS.EOF
tmpEM = tmpEM & Nz(RS.Fields(0).Value, "") & ";"
RS.MoveNext
Loop
EmailonQ = tmpEM
Set RS = Nothing
End Function
Much appreciate any help resolving...