tramite il codice che riporto eseguo una ricerca in un database access e lo evidenzio in un datagrid e fin qui tutto bene , io vorrei evidenziare i record ricercati anche in delle textbox multilinea come posso fare.
Grazie
codice:Dim col As Integer, num As Integer Dim v(1 To 10) As String Dim r As Integer Dim conn As Connection Dim rs As Recordset Public sql As String Private Sub CmbMatricola_Click() stringa = InputBox("INSERISCI MATRICOLA", "ISERISCI MATRICOLA") If stringa = "" Then MsgBox "Input errato!", vbInformation, "Input errato" Exit Sub End If sql = "select * from ore where matricola='" & stringa & "';" Call query(sql) Call init End Sub Private Sub Cmbseleziona_Click() With ope.DataGrid1 .AllowAddNew = True .AllowDelete = True .AllowUpdate = True End With sql = "select * from ore;" Call query(sql) End Sub Sub query(str As String) Set cn = New ADODB.Connection Set rs = New ADODB.Recordset cn.Provider = "microsoft.jet.oledb.4.0" cn.ConnectionString = "C:\ORE.mdb" cn.Open rs.LockType = adLockOptimistic rs.CursorLocation = adUseClient rs.Source = str Set rs.ActiveConnection = cn rs.Open If rs.EOF Then MsgBox "Nessun record trovato", vbInformation, "Ricerca fallita" Exit Sub End If Set ope.DataGrid1.DataSource = rs End Sub Sub init() With ope.DataGrid1 .AllowAddNew = False .AllowDelete = False .AllowUpdate = False End With End Sub

Rispondi quotando