my code:
Possible to find MyString ( as string dimensioned) without loop the array (it contain approx 150000 item!)
and return a booelean=true is the string is in array.
my test esperiment but dont work!!!
STRINGA = UBound(Filter(BIG_ARRAY, Me.CCOMNASC.Text)) > -1
STRINGA = InStr(1, Join(BIG_ARRAY, vbNullChar), Me.CCOMNASC.Text) > 0
If InStr(Join(BIG_ARRAY), Me.CCOMNASC.Text) > 0 Then Stop
Code:
...
IN MODULE
PUBLIC BIG_ARRAY() As Variant
IN MODULE
'BIG ARRAY
SQL = "SELECT DESCRIZIONE & ' - ' & CODICE & ' - (' & PROVINCIA & ')' AS RIGA FROM COMUNI UNION SELECT DESCRIZIONE & ' - ' & CODICE & ' - (' & PROVINCIA & ')' AS RIGA FROM STATI "
Set RSB = New ADODB.Recordset
RSB.CursorLocation = adUseClient
SQL = "SELECT DESCRIZIONE & ' - ' & CODICE & ' - (' & PROVINCIA & ')' AS RIGA FROM COMUNI"
RSB.Open Source:=SQL, _
ActiveConnection:=CON, _
CursorType:=adOpenForwardOnly, _
LockType:=adLockReadOnly
RSB.Sort = ("RIGA")
RSB.MoveFirst
Erase BIG_ARRAY()
BIG_ARRAY = RSC.GetRows()
RSB.Close
Set RSB = Nothing
'BIG ARRAY
Possible to find MyString ( as string dimensioned) without loop the array (it contain approx 150000 item!)
and return a booelean=true is the string is in array.
my test esperiment but dont work!!!
STRINGA = UBound(Filter(BIG_ARRAY, Me.CCOMNASC.Text)) > -1
STRINGA = InStr(1, Join(BIG_ARRAY, vbNullChar), Me.CCOMNASC.Text) > 0
If InStr(Join(BIG_ARRAY), Me.CCOMNASC.Text) > 0 Then Stop