Visualizzazione dei risultati da 1 a 2 su 2
  1. #1
    Utente di HTML.it
    Registrato dal
    Oct 2002
    Messaggi
    34

    ricerca dinamica in una combo

    ho una combo allacciata ad un database tramite il controllo data1.come faccio a immettere una ricerca dinamica nella combo.

    se digito d mi da tuttti quelli con la d se digito da tutto quelli che iniziano per da

    ho trovato questo codice in unaltro programma funziona nel mio no??

    potete aiutarmi??



    Private Sub Combo3_Click()

    If Combo3.Text <> "" Then
    Modifica = 1
    If Data2.Recordset.EOF <> True Or Data2.Recordset.BOF <> True Then
    Data2.Recordset.MoveFirst
    Do While Not Data2.Recordset.EOF
    If Combo3.Text = (Data2.Recordset("C_RagSociale")) Then

    Exit Do
    End If
    Data2.Recordset.MoveNext
    Loop

    End If
    End If

    End Sub


    ************************************************** *******************

    Private Sub Combo3_GotFocus()

    Dim Risposta As Integer
    'On Error Resume Next
    If Inserisci = 1 Then
    Risposta = MsgBox("Attenzione il nuovo inserimento andrà perso", vbYesNo + vbInformation, "Continuare la ricerca")
    If Risposta = vbYes Then
    Data2.Recordset.CancelBatch
    Inserisci = 0
    'CmdInserisci.Enabled = True
    Else
    Exit Sub
    End If
    Combo3.Clear
    If Data2.Recordset.EOF <> True And Data2.Recordset.BOF <> True Then
    Data2.Recordset.MoveFirst
    Do While Not Data2.Recordset.EOF
    Combo3.AddItem (Data2.Recordset("C_RagSociale"))
    Data2.Recordset.MoveNext
    Loop
    End If
    End If
    Primo = ""
    Lettere = 0

    End Sub

    ************************************************** ********************



    Private Sub combo3_KeyUp(KeyCode As Integer, Shift As Integer)

    Dim I As Integer
    'MsgBox KeyCode
    'MsgBox KeyCode
    Select Case KeyCode
    Case Is = 8
    Combo3.SelText = ""
    If Lettere = 0 Then
    Lettere = 0
    Else
    Lettere = Lettere - 1
    End If
    Combo3.Text = Left(Combo3.Text, Lettere)
    Combo3.SelStart = Len(Combo3.Text)
    Primo = Combo3.Text
    'Lbl1.Caption = Lettere
    'LBL2.Caption = Primo
    Case Is = 13
    Combo3.SelStart = Len(Combo3.Text)
    Combo3_Click
    Case Is = 32
    If Combo3.Text = "" Then
    Primo = ""
    Lettere = 0
    Else
    Lettere = Lettere + 1
    End If
    Primo = Primo & Chr(KeyCode)
    Combo3.SelText = ""
    For I = 0 To Combo3.ListCount - 1
    If Primo = Left(Combo3.List(I), Lettere) Then
    Combo3.Text = Primo & Right(Combo3.List(I), Len(Combo3.List(I)) - Lettere)
    Exit For
    End If
    Next
    'Lbl1.Caption = Lettere
    'LBL2.Caption = Primo
    Combo3.SelStart = Lettere
    Combo3.SelLength = Len(Combo3.Text)
    Case Is = 46
    Combo3.Text = ""
    Lettere = 0
    Primo = ""
    Case Is >= 65
    If Combo3.Text = "" Then
    Primo = ""
    Lettere = 0
    Else
    Lettere = Lettere + 1
    End If
    Primo = Primo & Chr(KeyCode)
    Combo3.SelText = ""
    For I = 0 To Combo3.ListCount - 1
    If Primo = Left(Combo3.List(I), Lettere) Then
    Combo3.Text = Primo & Right(Combo3.List(I), Len(Combo3.List(I)) - Lettere)
    Exit For
    End If
    Next
    'Lbl1.Caption = Lettere
    'LBL2.Caption = Primo
    Combo3.SelStart = Lettere
    Combo3.SelLength = Len(Combo3.Text)
    End Select

    End Sub

  2. #2
    non è che mi daresti il codice, capire qualcosa con tutto quel casino è un impresa. Se lo zippi e lo rinomini come .gif non dovrebbero esserci problemi ad allegarlo nel messaggio

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.