Solved

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

Posted on 2004-09-14
7
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: 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 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Make the most of your online learning experience.
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…
Introduction to Processes

634 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