jack niekerk
asked on
RESHOWING ADOGRID WHEN I WANT TO GO BACKWARDS FROM ROW 30000 TO ROW 100
While typing in a txtbox on event change I do this to let the grid scroll with any
character typed
Only one problem , first records starts at AB-001 untill ZZZ-9999 last,
grid has 30000 records, so when I start typing e.g. NIC-123 grid scrolls
ok to first found, but if I make type error like NIX- and do backspace
grid is not scrolling backwards because it passed that row already
How to make it scrolling backwards specialy if you would go like back to N,
or even back to nothing and want to start with e.g. BA etc.
Clicking op adocontrol << would solve but thats not what I want.
Private Sub TxtCustomerSearch_Change()
Dim Count As Integer
Dim LastRow As Boolean
On Error GoTo ErrHandle:
Count = 0
Do Until LastRow
Customgrid.Row = Count
Customgrid.Col = 1
If UCase(Mid(Customgrid.Text, 1, Len(TxtCustomerSearch.Text ))) = UCase(TxtCustomerSearch.Te xt) Then
DisplayFields
exit sub
End If
Count = Count + 1
Loop
ErrHandle:
End Sub
character typed
Only one problem , first records starts at AB-001 untill ZZZ-9999 last,
grid has 30000 records, so when I start typing e.g. NIC-123 grid scrolls
ok to first found, but if I make type error like NIX- and do backspace
grid is not scrolling backwards because it passed that row already
How to make it scrolling backwards specialy if you would go like back to N,
or even back to nothing and want to start with e.g. BA etc.
Clicking op adocontrol << would solve but thats not what I want.
Private Sub TxtCustomerSearch_Change()
Dim Count As Integer
Dim LastRow As Boolean
On Error GoTo ErrHandle:
Count = 0
Do Until LastRow
Customgrid.Row = Count
Customgrid.Col = 1
If UCase(Mid(Customgrid.Text,
DisplayFields
exit sub
End If
Count = Count + 1
Loop
ErrHandle:
End Sub
Determine if the backspace key was pressed and set your counter = -1 instead of +1
ASKER
If life was that simple, if you take a good look at source you will see that depending
on value of keyhit it could be that differance between last hit(and thus bookmark in grid) and keyvalue before doing backspace based on alfa value can be more then -1 could be -80 as example.
on value of keyhit it could be that differance between last hit(and thus bookmark in grid) and keyvalue before doing backspace based on alfa value can be more then -1 could be -80 as example.
Doesn't your code loop through the rows looking for the text string that has been typed so far?
ASKER
the problem will be in adogrid that only last 60 records read are in memory/buffer/screen whatever you name it. so even putting customgrid.Row =0 won't work if the bookmark is due to typing e.g. YX-123 allready something like 20000, so lowering custogrid.Row even with 200 will not reshow grid on screen, so how about 10000 backwards.
Jack
Jack
are you in vb 6 or .net?
ASKER
VB6 with Pervasive (btrieve)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.