This is probably something very obvious, but I'm experiencing brain block on it so far.
I'm trying to send emails to multiple users, and the message sent depends on a T/F column in one of the tables. Setting up the database prior to sending the note is what's not allowing me to compile. I receive this error:
Run-time error '3061.'
Too few parameters. Expected 2.
I tried hitting help, but nothing comes up. The debug pgm points to the "Set rstEmail..." line in the following code:
VB is looking for a second parameter, but I don't understand what it is. Can anyone help?
Thanks in advance,
Kerry
I'm trying to send emails to multiple users, and the message sent depends on a T/F column in one of the tables. Setting up the database prior to sending the note is what's not allowing me to compile. I receive this error:
Run-time error '3061.'
Too few parameters. Expected 2.
I tried hitting help, but nothing comes up. The debug pgm points to the "Set rstEmail..." line in the following code:
Code:
'Send email notifications to CardHolders
Set dbs = CurrentDb
Set qryEmail = dbs.QueryDefs("qryEmailInfo")
qryEmail.Parameters("pHeaderID") = CLng(txtHeaderID)
Set rstEmail = qryEmail.OpenRecordset
With rstEmail
If .RecordCount > 0 Then
Do While Not .EOF
' Check for missing data
' Email address
If Nz(.Fields("StaffEmail")) = "" Then
MsgBox "Card holder, " & .Fields("StaffFName") & " " & .Fields("StaffLName") & _
", does not have an email address" & vbCrLf & _
"Check listing against sent items folder", _
vbInformation + vbOKOnly, _
"Missing Email"
Else
strTo = .Fields("StaffEmail")
.
.
.
VB is looking for a second parameter, but I don't understand what it is. Can anyone help?
Thanks in advance,
Kerry