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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filtering Records In a text Box

Status
Not open for further replies.

romanalcontin

Programmer
Aug 12, 2002
1
0
0
PH
Hi, I'm Roman From Cebu City Philippines, Please help me to figure out if there is such a function in visual basic that will determine if a user will stop typing in a textbox so that i can trigger the 'TextChange' event that will refresh my record query in a grid that is bind to a ado data control.
It is logical for me to begin the query after the user had finished typing of what he/she is searching because there is a slight delay in displaying a thousand records that I fetch from database. Bec. every time character is typed in the textbox, my query will then refresh for that particular category and my client is very fast in typing in the filter textbox so a delay in displaying the records occurs

Ex. Code:

Private Sub Text2_Change()

adodc1.recordsource = "Select * from Item Where ItemCode like '" & %& text2.text & "'"
adodc1.refresh

End Sub


. I also found out to my friend using visual foxpro that there is a function "ChrSaw(nseconds)" Function that Determines the lapse time since the user start typing.Is there an equivalent Function In the VisualBasic

I shall appreciate Your Quick Response.Thank You


----Roman Q. Alcontin
April 01,2003
Cebu City Philippines
roman7_2000@yahoo.com


 
Have you tried using LostFocus instead of Change ?

i.e.:
Private Sub Text2_LostFocus()

Best wishes,
Ralph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top