-----Original Message-----
OK, roll up your sleeves and get ready to get your hands dirty because we're
going under the hood. :~)-
First of all you can forget about the global variable. It seems I was
mistaken and it's not needed for this scenario after all which should help
to simplify things a bit.
Two events to work with are the Change event of the text box, and the Timer
event of the form. In the Change event, we will set the timer interval:
----------
Private Sub MyTextBox_Change()
' Reset the timer interval (also resets any pending timer events)
Me.TimerInterval = 1000 ' Sets the timer to 100 milliseconds (1 second,
recommended)
End Sub
----------
Now, in the Timer event, we will update the listbox accordingly:
----------
Private Sub Form_Timer()
Dim strSQL As String ' SQL string to update listbox
' First we turn off the timer
Me.TimerInterval = 0
' Then we update the listbox
strSQL = "SELECT [MyField1], [MyField2], [MyField3] FROM [MyTable] " & _
"WHERE ([MyField] = '" & MyTextBox.Text & "');"
MyListBox.RowSource = strSQL
MyListBox.Requery
End Sub
----------
You must use the Text property of the textbox during real-time operation as
the Value property does not get updated until the textbox loses focus. The
SQL string can be basically rebuilt from a query you design using the query
builder in access. Just change the view to SQL View in the query, and
you'll see a statement very much like the one I've assigned to the string.
This should get you moving in the right direction. If you have any
questions, please let me know.
- Glen
Cind said:
Cind,
Not very much at all, I have the set timer to 100 right
now, i have an ontimer event, but i dont really get where
and how to declare a global variable and how to use it to
lag the particular sub . Thanks
Cind
id
like
.