Solved

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

Posted on 1998-10-09
2
249 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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that 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

12 Experts available now in Live!

Get 1:1 Help Now