Non è sufficiente dire non funge.
Che errore ti dà?
RSTctr è il nome dichiarato del RecordSet, che mi sembra tu chiami Rs .
Ti aggiungo anche le dichiarazioni:
codice:Dim Cns1 As New ADODB.Connection Dim Rs As New ADODB.Recordset 'Esegue la connessione con il DataBase TblAnagraficaPROF: With Cns1 .ConnectionString = DataConnessione .CursorLocation = adUseClient 'tipo di cursore .Mode = adModeShareDenyNone 'nessuna limitazione .CommandTimeout = 15 .Open End With ' Controlla che il professionista ed il progetto NON sia inserito già nel BD: Rs.Source = "SELECT nome FROM TblAnagraficaPROF WHERE nome='" & TuoFrm.txtNome.Text & "'" Rs.Open , Cns1 ' Il Professionista è presente nel DB, esce dalla routine: If Rs.EOF = False And Rs.BOF = False Then MsgBox "Il professionista: " & TuoFrm.txtNome.Text & Chr(13) _ & "è già registrato nel database.", vbInformation + vbOKOnly, " ........... " Exit Sub End If

Rispondi quotando