Solved

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

Posted on 2004-09-14
7
222 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 

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 250 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
firstswap challenge 20 77
how to send memory stream from ics Client To ics server ? 11 106
Hide vba in gp 7 94
C# DataGridView_RowsAdded event not firing 1 74
I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

770 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