K
Kay
HI,
I thought I posted this message earlier, but I can't find it on the site, so
I apologize if this is a repeat. I have imported a module from Microsoft
Developer Site to use a text box to search a list box. Is there any reason
why the vb will not work in 2003? I have implemented as microsoft suggested,
but while the text box will show the value of the item i choose in the list
box, the text box does not find the value that I type in it in the list box.
The sample database works perfectly. I use the find method example, because
I must base the listbox off of a query, so that i can reference another
unbound text box on my form that passes my phone index data. My search
textbox is called txtProviders, the list box is lstUnionALL
Code against the form and controls are as follows: I can post the code for
the basSeach module if necessary.
Option Compare Database
Option Explicit
Private mc As clsMonthCal
Private Sub lstUnionAll_AfterUpdate()
UpdateSearch Me.txtProviders, Me.lstUnionAll
End Sub
Private Sub txtProviders_Change()
Dim varRetval As Variant
varRetval = SearchRecordset(Me.txtProviders, Me.lstUnionAll, "Providers")
' You could check for errors like this:
' In this case, though, you just don't care.
'
'If IsError(varRetval) Then
' MsgBox "Error: " & varRetval
End Sub
Private Sub txtProviders_Exit(Cancel As Integer)
UpdateSearch Me.txtProviders, Me.lstUnionAll
End Sub
I thought I posted this message earlier, but I can't find it on the site, so
I apologize if this is a repeat. I have imported a module from Microsoft
Developer Site to use a text box to search a list box. Is there any reason
why the vb will not work in 2003? I have implemented as microsoft suggested,
but while the text box will show the value of the item i choose in the list
box, the text box does not find the value that I type in it in the list box.
The sample database works perfectly. I use the find method example, because
I must base the listbox off of a query, so that i can reference another
unbound text box on my form that passes my phone index data. My search
textbox is called txtProviders, the list box is lstUnionALL
Code against the form and controls are as follows: I can post the code for
the basSeach module if necessary.
Option Compare Database
Option Explicit
Private mc As clsMonthCal
Private Sub lstUnionAll_AfterUpdate()
UpdateSearch Me.txtProviders, Me.lstUnionAll
End Sub
Private Sub txtProviders_Change()
Dim varRetval As Variant
varRetval = SearchRecordset(Me.txtProviders, Me.lstUnionAll, "Providers")
' You could check for errors like this:
' In this case, though, you just don't care.
'
'If IsError(varRetval) Then
' MsgBox "Error: " & varRetval
End Sub
Private Sub txtProviders_Exit(Cancel As Integer)
UpdateSearch Me.txtProviders, Me.lstUnionAll
End Sub