Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

aotocomplete combobox

Status
Not open for further replies.

sal21

Programmer
Apr 26, 2004
422
IT

i fill a comobox with this code

Code:
Set RS = New ADODB.Recordset
    RS.CursorLocation = adUseClient
    SQL = "SELECT * FROM COMUNI"
    RS.Open Source:=SQL, _
            ActiveConnection:=CON, _
            CursorType:=adOpenForwardOnly, _
            LockType:=adLockReadOnly
    RS.Sort = ("DESCRIZIONE")

    Erase strDBRows()
    strDBRows = RS.GetRows()
    RS.Close
    Set RS = Nothing

    With Me.CCOMNASC
        .Clear
        For I = 0 To UBound(strDBRows, 2)
            .AddItem Trim(strDBRows(0, I)) & "-" & Trim(strDBRows(1, I)) & "-(" & Trim(strDBRows(2, I)) & ")"
      Next I
    End With

possible to autocomplete Me.CCOMNASC.txt, during the keypress, based the field strDBRows(1, I)?

note:
part of record
CODICE DESCRIZIONE PROVINCIA
401001001 AGLIE' TO
401001002 AIRASCA TO
401001003 ALA DI STURA TO
401001004 ALBIANO D'IVREA TO
401001005 ALICE SUPERIORE TO
401001006 ALMESE TO
401001007 ALPETTE TO
401001008 ALPIGNANO TO
401001009 ANDEZENO TO
401001010 ANDRATE TO
401001011 ANGROGNA TO
401001012 ARIGNANO TO
401001013 AVIGLIANA TO
401001014 AZEGLIO TO
401001015 BAIRO TO
401001016 BALANGERO TO
401001017 BALDISSERO CANAVESE TO
401001018 BALDISSERO TORINESE TO
401001019 BALME TO
401001020 BANCHETTE TO
401001021 BARBANIA TO
401001022 BARDONECCHIA TO
 
Sadly VB6 does not have native autocomplete functionality for text controls.

So you pretty much have to write that functionality for yourself from scratch.

If you are not averse to using 3rd party controls, then FreeVBCode have a (quite old now) autocompleting textbox control that might be a good starting point
 
strongm, is for a web browser...
 
No, it isn't. That's just the fully worked example using the control. But the control itself does NOT have to be used for URLs or a browser.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top