Solved

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

Posted on 2004-09-14
7
220 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
Comment Utility
Determine if the backspace key was pressed and set your counter = -1 instead of +1
0
 

Author Comment

by:BIAPRO
Comment Utility
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
Comment Utility
Doesn't your code loop through the rows looking for the text string that has been typed so far?
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:BIAPRO
Comment Utility
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
Comment Utility
are you in vb 6 or .net?
0
 

Author Comment

by:BIAPRO
Comment Utility
VB6  with Pervasive (btrieve)
0
 
LVL 3

Accepted Solution

by:
RacinRan earned 250 total points
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
A short article about a problem I had getting the GPS LocationListener working.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

772 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now