You must modify the Sql predicate of the DoctorAndPodiatristQ query, without the need for any parameter declaration, as follows
and leave the line of code for sending the email unchangedCode:SELECT ResidentsName, AppointmentTime, DoctorOrPodiatrist FROM DoctorAndPodiatristTB WHERE DoctorOrPodiatrist = [DoctorOrPodiatristParameter]
Code:DoCmd.SendObject acSendQuery, "DoctorAndPodiatristQ", acFormatRTF, "rwshea220540@outlook.com", , , "Test", "Sending an email from VBA"