grazie mille per l'aiuto![]()
codice:Private Sub Command1_Click() risTITOLO.Text = "" risID.Text = "" Dim NomeDaCercare As String Dim Found As Boolean Dim IdTrovato As String Dim TitoloTrovato As String NomeDaCercare = InputBox$("Immettere il nome da ricercare:", _ "Ricerca nell'agenda") If NomeDaCercare <> "" Then With Data1 While Not .Recordset.EOF If UCase(.Recordset("Cognome")) Like "*" & _ UCase(NomeDaCercare) & "*" Then TitoloTrovato = .Recordset("Cognome") risTITOLO.Text = risTITOLO.Text & vbNewLine & _ TitoloTrovato IdTrovato = .Recordset("Nome") risID.Text = risID.Text & vbNewLine & IdTrovato Found = True .UpdateControls End If .Recordset.MoveNext Wend If Found = False Then .Recordset.MoveFirst .UpdateControls MsgBox "Nome non trovato.", vbInformation, Me.Caption End If End With End If End Sub
*************************************
Nota del moderatore: per favore, ricordati di usare i tag quando scrivi righe di codice, in modo da facilitare la lettura e la comprensione per chi vuole aiutarti.

Rispondi quotando

