Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

RESHOWING ADOGRID  WHEN I WANT TO GO BACKWARDS FROM ROW 30000 TO ROW 100

Posted on 2004-09-14
7
Medium Priority
?
232 Views
Last Modified: 2010-04-17
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.Text) Then
            DisplayFields
            exit sub
            End If
       Count = Count + 1
    Loop
  ErrHandle:
End Sub

0
Comment
Question by:BIAPRO
  • 4
  • 3
7 Comments
 
LVL 3

Expert Comment

by:RacinRan
ID: 12055840
Determine if the backspace key was pressed and set your counter = -1 instead of +1
0
 

Author Comment

by:BIAPRO
ID: 12056769
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.
0
 
LVL 3

Expert Comment

by:RacinRan
ID: 12056870
Doesn't your code loop through the rows looking for the text string that has been typed so far?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:BIAPRO
ID: 12056984
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
0
 
LVL 3

Expert Comment

by:RacinRan
ID: 12057093
are you in vb 6 or .net?
0
 

Author Comment

by:BIAPRO
ID: 12057204
VB6  with Pervasive (btrieve)
0
 
LVL 3

Accepted Solution

by:
RacinRan earned 500 total points
ID: 12057411
If this is being displayed in a grid it should be a datagrid.  Instead of using an ado control to handle the recordset your probably going to have to handle it yourself.  That means declaring a recordset and filling it with all 30K records and then use that as the data source for your grid so you can see all the records.  As you scroll you'll scroll through the recordset object and then refresh the datagrid to match the current state of the recordset to keep them in sync.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Loops Section Overview
Screencast - Getting to Know the Pipeline

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question