Solved

USING MULTIPLE ADO RECORD SETS ON MAINFORM

Posted on 2004-09-07
3
165 Views
Last Modified: 2010-04-17
Have 1 form, on form textblocks for DriverId,name,street, etc.. for this data adorecord set,
second adrecordset contains table with licenseplate numbers belonging to a DriverId,
then a third adorecordset contains table with list off accidentreports belonging to DriverId.
What I trying to figure out:
In DriverId txtbox e.g. looking for JACK-01, start typing in J,A,C,K  etc. how to let datagrid
at same moment scroll while typing letter J/A/C/K etc to postition in grid on screen.
So if more JACKS exist they show on order etc.
Then when I pick e.g. JACK-01, how to make call (in record JACK-01  I have key for both accidentreport and licenseplate)  how to make call to second recordset with key and same
for third.
Regards Jack
0
Comment
Question by:BIAPRO
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 500 total points
ID: 12003340
I hope you are using VB

First problem:
In order to show relevent names as user keeps typing trap the change event of the textbox where user is typing JACK...
on the change event filter the recordset with whatever has been typed so far and populate the grid
However this might slow down the Interface a bit, a better more elegent solution is to have all IDs in a comboBox, user can select from it also you can easily implement autocomplete type of feature in combobox so that as soon as user types Jack, Jack-01 comes automatically on the press of a character that makes the name unique like in unix.

Second Problem:
Here also the same solution, filter, your other two recordsets must be containig the key field DriverID you need to filter the two recordsets based on the driver id
AdoRecordset1.Filter="DriverID='" & TxtDriverID.Text & "'"
then show the records
0
 

Author Comment

by:BIAPRO
ID: 12053706
Ok based on your info I did this.
Only one problem left ,  the records start at  AB-001  untill ZZZ-9999
in file 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.
Ok clicking op adocontrol <<  would solve but thats not sofisticated.
Regards Jack


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
            GoTo endSub
            End If
       Count = Count + 1
    Loop
    Exit Sub
   
endSub:
   Count = 0
   Do Until LastRow
       dtgrdLicense.Row = Count
       dtgrdLicense.Col = 1
       If UCase(Mid(dtgrdLicense.Text, 1, Len(txtCustomerId))) = UCase(txtCustomerId) Then
         Exit Sub
        End If
        Count = Count + 1
    Loop
ErrHandle:
End Sub
0
 

Author Comment

by:BIAPRO
ID: 12091935
I forget about ADO,  I wrote (yes, its more work) a APX module with Vaccess and a. will work, b.  MUCH faster.
Thanks anyway
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
My project did see openJDK that I installed. What could be the problem 7 120
Excel object stays open 19 70
nestparen challenge 4 72
PHP question(s) about order of output 9 57
RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
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…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

937 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

1 Experts available now in Live!

Get 1:1 Help Now