I think I could do with less criticism from the likes of you. I am trying to solve the problem myself as much as I can so that I might learn something, but since you asked:
Dim strSQL As String
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
strSQL = "SELECT...