Una famiglia di sistemi di gestione per database relazionali di Microsoft progettati per semplificare l'uso.
Prima ho aggiustato la tua routine, ma io in realtà scriverei così:
Option Explicit
Option Compare Database
Private Sub Comando9_Click() ' Ma lo chiamerei cmdOK
On Error GoTo ErrorHandler
Dim db As DAO.Database
Dim sql As String
Dim rst As DAO.Recordset
Dim b As Boolean
' Ma li chiamerei txtNome e txtPassword
If Len(Testo5.Value) And Len(Testo1.Value) Then
Set db = CurrentDb
sql = "SELECT *" & _
" FROM Nomi" & _
" WHERE [Nome utente]='" & Testo5.Value & "';"
Set rst = db.OpenRecordset(sql)
With rst
If .BOF And .EOF Then
' Nessun record
Else
b = .Fields("Password").Value = Testo1.Value
End If
End With
If b Then
DoCmd.Close acForm, Me.Name
Else
MsgBox "Nome Utente inesistente o Password errata." ' Perché
' non è bene dare troppe informazioni al riguardo
End If
Else
MsgBox "Inserire Nome Utente e Password!"
End If
ExitProcedure:
On Error Resume Next
rst.Close
Set rst = Nothing
Set db = Nothing
Exit Sub
ErrorHandler:
MsgBox Err.Description
Resume ExitProcedure
End Sub