Hi All
I have created a database that allows for the emailing of a standard message to multiple email address via a module and VBA code. This creates a recordsource from a query.
All work well, however, if I add parameters to the underlying query, I get a RunTime 3061 error too few paramaters.
Here's the code that it highlights
Basically, I need to filter out the list of email addresses where the EventID is equal to that on the form together with the AmountPaid = null
The underlying query is thus
Any help in where I am going wrong would be great.
I have created a database that allows for the emailing of a standard message to multiple email address via a module and VBA code. This creates a recordsource from a query.
All work well, however, if I add parameters to the underlying query, I get a RunTime 3061 error too few paramaters.
Here's the code that it highlights
Code:
Set rs = db.OpenRecordset("SELECT PName, PEmail, EventName, EmailSent, EmailSentDate, EventID, EventDate, AmountPaid " & _
" FROM qryEmailAddresses", dbOpenDynaset)
Basically, I need to filter out the list of email addresses where the EventID is equal to that on the form together with the AmountPaid = null
The underlying query is thus
Code:
SELECT tblParticipants.PName, tblParticipants.PEmail, tblBookings.EventID, tblEvents.EventName, tblEvents.EventDate, tblBookings.AmountPaid, tblBookings.EmailSent, tblBookings.EmailSentDate
FROM (tblBookings INNER JOIN tblEvents ON tblBookings.EventID = tblEvents.EventID) INNER JOIN tblParticipants ON tblBookings.ParticipantID = tblParticipants.ParticipantID
WHERE (((tblBookings.EventID)=[forms]![frmBookingReport]![EventID]) AND ((tblBookings.AmountPaid) Is Null) AND ((tblBookings.EmailSent)=0));
Any help in where I am going wrong would be great.