I am trying to retrieve data from 3 different tables. one has customer name, one has booking date and status of booking and the third has whether a kennel has been allocated to a booking. table one is linked to table 2 by cust_no and two linked to 3 by booking_no I am trying to find the surname, date of booking of bookings where a kennel has not been allocated to a pet. my code is:

Set rs1 = db.OpenRecordset("select tblCustomer.surname, tblbooking.booking_no, tblbooking.date_in from tblCustomer, tblBooking, tblBooking_details where tblBooking.cust_no = tblCustomer.cust_no and tblbooking.booking_no = tblBooking_details.booking_no and tblBooking_details.kennel_no = ' " & stat & " ' order by surname ")

Please someone tell me what i have domne wrong as i am pulling my hair out.

I am not sure if I need extra quotes or & in the code.