Private Sub cmdInvia_Click()
If txtCognome = "" Or txtNome = "" Then
MsgBox "Inserisci i campi obblibatori * mancanti", vbInformation
Else
DimiCognome , iNome
iCognome = txtCognome
iNome = txtNome
Dim Cnn As ADODB.Connection
Dim Rst As ADODB.Recordset
Set Cnn = New Connection
Set Rst = New Recordset
Cnn.Open "Provider=............."
Set Rst = Cnn.Execute("Select ........... From nomeTabella ...")
Do While Not Rst.EOF
If CampoNome = iNome And CampoCognome = iCognome Then
MsgBox ("Nomi e cognome già presenti")
Else
Rst.AddNew
Rst("Nome")="txtNome.text
Rst("Cognome")="txtCognome.text
Rst.Update
Rst.MoveNext
Loop
Set Rst = Nothing
Set Cnn = Nothing
Exit Sub
End If
End If