codice:
 If no_inattivi = False Then
                criterio1 = "[livello] = " & Str(liv_o_MOD)
            Else
                criterio1 = "[livello] = " + Str(liv_o_MOD) + _
                " and [attiva] = true"
            End If


 Dim dbs As DAO.Database
        Dim rst As DAO.Recordset


        'Get the database and Recordset
        dbs = DBE.OpenDatabase(nome1) 'CurrentDb
        rst = dbs.OpenRecordset("stanze")


        'Search for the first matching record   
        rst.FindFirst(criterio)


        'Check the result
        If rst.NoMatch Then
            MsgBox("Record non trovato.")
            ' da cambiare
        End If


        For Each fld In rs1.Fields


            Dim st As Integer = Val(fld.value(numero_stanza))