Have used this string successfully now to send emails out to participants who haven't paid.
Basically, the table hold Event Bookings for each participant. In order to class a Booking Confirmed, the Participant needs to have paid AND sent in their Public Liability Insurance Certificate.
What i am trying to do now is to send out reminder emails to Participants who have not confirmed their booking, as described above.I guess an IIF statement needs to be put after the where clause but can't seem to get my head round it. I can do the IIF statement in a normal query.
This send the email to those who have not paid.
This is an IFF Statement from a query which does what I need it to do.
I'm just struggling to marry the two up so to speak.
Any help would be gratefully received.
Basically, the table hold Event Bookings for each participant. In order to class a Booking Confirmed, the Participant needs to have paid AND sent in their Public Liability Insurance Certificate.
What i am trying to do now is to send out reminder emails to Participants who have not confirmed their booking, as described above.I guess an IIF statement needs to be put after the where clause but can't seem to get my head round it. I can do the IIF statement in a normal query.
This send the email to those who have not paid.
strSQL = "SELECT tblbookings.EventID, tblParticipants.PEmail, tblBookings.AmountPaid, tblEvents.EventName, tblEvents.EventDate, tblParticipants.PName, tblBookings.PLReceived, tblbookings.ReminderEmailSent, tblbookings.ReminderEmailSentDate FROM (tblParticipants INNER JOIN tblBookings ON tblParticipants.ParticipantID = tblBookings.ParticipantID) INNER JOIN tblEvents ON tblBookings.EventID = tblEvents.EventID WHERE (((tblBookings.EventID)= " & [Forms]![frmBookingReport]![EventID] & ") AND (Nz(tblBookings.AmountPaid,0) =0));"
This is an IFF Statement from a query which does what I need it to do.
Confirmed: IIf([tblbookings.amountpaid] Is Not Null And [tblbookings.plreceived]="Yes","Confirmed","Not Confirmed")
I'm just struggling to marry the two up so to speak.
Any help would be gratefully received.