Dim db As Database 'generic database object Dim rst As Recordset 'this is going to hold the query result Dim strsql As String 'this will be your sql statement Set db = CurrentDB 'tell access to use ...