Una famiglia di sistemi di gestione per database relazionali di Microsoft progettati per semplificare l'uso.
ciao Ciro,
data la tabella :
e la form che segue :
ed in visualizzazione normale ottengo :
e
al raggiungimento della digitazione dell'ottavo carattere a seconda del fatto che il match tra quanto digitato e quanto trovato ci sia o meno.
con questa codice VBA.
Prova a vedere se ti e' di aiuto.
Ciao, Sandro.
Option Compare Database
Option Explicit
Private strFilter As String
Private Sub Form_Close()
With Me
.Filter = vbNullString
.FilterOn = False
End With
End Sub
Private Sub Form_Open(Cancel As Integer)
With Me
.Filter = "1=0"
.FilterOn = True
End With
End Sub
Private Sub txtSearch_Change()
With Me.txtSearch
If Len(.Text) = 8 Then
strFilter = "codice='" & .Text & "'"
.Parent.Filter = strFilter
.Parent.FilterOn = True
With Me.RecordsetClone
If .RecordCount = 0 Then
VBA.MsgBox prompt:="Codice non trovato!", _
Buttons:=vbCritical + vbOKOnly, _
title:="Attenzione!"
Me.txtSearch.Value = vbNullString
End If
End With
End If
End With
End Sub
se l'origine dati non dovesse essere una tabella, qualche ulteriore intervento e' necessario sul fronte recordCount.