I have the following SQL which works fine in an access database, however how does one refer to forms in a SQL database.
Code:
SELECT tblSchools.SchoolID, tblSchools.SchoolName, tblSchools.Phone, tblSchools.AddressLine1, Postcode.Town, State.StateAbv, Postcode.Postcode, tblSchools.SchoolID, qryCountofBookings.[Number of Bookings]
FROM (State INNER JOIN (tblSchools INNER JOIN Postcode ON tblSchools.PostcodeID = Postcode.PostcodeID) ON State.StateID = Postcode.StateID) LEFT JOIN qryCountofBookings ON tblSchools.SchoolID = qryCountofBookings.SchoolID
WHERE (((RemovePunc([tblSchools].[SchoolName])) Like "*" & [Forms]![frmSearch]![Search2] & "*") AND ((State.StateID) Like "*" & [Forms]![frmSearch]![cboState] & "*")) OR (((tblSchools.SchoolID) Like "*" & [Forms]![frmSearch]![Search2] & "*") AND ((State.StateID) Like "*" & [Forms]![frmSearch]![cboState] & "*"))
ORDER BY tblSchools.SchoolName;