|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
What i have is the following code. I have only got three control, data listbox and textbox.
From the data control i fill the list box with a list of phone number from an access mdb file. The field is set to general text. I want the user to use the text box to see if a number appears in the listbox. What i am struggling to do is the get the list box to filter. I have pasted my code below, can anybodu help me. Option Explicit Private GR As Recordset Private R As Recordset Private Sub Form_Activate() Static b As Boolean If Not b Then Set GR = Data1.Recordset GR.Filter = "Phone1 Like '*" & Text1.Text & "*'" Set R = GR.OpenRecordset(dbOpenDynaset) LoadList b = True End If End Sub Sub LoadList() List1.Clear If R.RecordCount > 0 Then R.MoveFirst Do Until R.EOF List1.AddItem R!phone1 R.MoveNext Loop End If End Sub Private Sub Text1_Change() GR.Filter = "phone1 Like '*" & Text1.Text & "*'" Set R = GR.OpenRecordset(dbOpenDynaset) LoadList End Sub |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Filtering Listbox |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|