Solved

Using True DB Grid Pro 5, how do I read data from multiple selected records?

Posted on 1998-10-09
2
250 Views
Last Modified: 2013-12-26
Hi all,
I am using TDBG Pro 5 which is bound to a data control which in turn is bound to an Access 97 database. When I select multiple rows on the grid I would then like to be able to get the information from each of the selected records. At the moment I can only get the information from the current record. I tried this

    With TDBGrid1.SelBookmarks
        While .Count > 0
            Label1.Caption = Label1.Caption & CStr(Data1.Recordset.Fields(0))
            .Remove 0
            Data1.Recordset.Bookmark = TDBGrid1.Bookmark
        Wend
    End With

but it just added the same field of the same record for however many records were selected.
Thanks in advance.
0
Comment
Question by:scotslad
2 Comments
 
LVL 1

Accepted Solution

by:
CarlosJac earned 100 total points
ID: 1487557
Try this:

Dim i As Long

For i = 0 To TDBGrid1.SelBookmarks.Count - 1
    TDBGrid1.Bookmark = TDBGrid1.SelBookmarks(i)
    Label1.Caption = Label1.Caption & TDBGrid1.Columns(0).Text
Next i

Good luck
0
 

Author Comment

by:scotslad
ID: 1487558
Top notch man. It is so simple I should kick myself for not getting it. It's always the
simple ones staring you in the face that cause you problems. Thanks again. Top marks
to you.

Dave.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

939 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

10 Experts available now in Live!

Get 1:1 Help Now