MS FlexGrid

  • 19 years ago

    How can I found out the number of rows used in a flexgrid? My overall aim to is sum one of the columns, and I am going to use a For Next loop, but I need to determine the number of rows in the flexgrid. Below is my code…



    Data1.DatabaseName = App.Path & "\data.mdb"
    Data1.RecordSource = "select * from table" & IndexCtrl & " order by Date"


    For i = MSFlexGrid1.FixedRows To MSFlexGrid1.Rows – 1
    Total = Total + Val(MSFlexGrid1.TextMatrix(i, 2))
    Next


    IndexCtrl is a byte and simply determines which table number to look at in the database.


    The MSFlexGrid1.Rows only seems to return the number of rows present as design-time, and since the information from the database is displayed in the flexgrid, the number of rows changes depending on the number of rows of information in the database table. How do I find out how many rows are being used in the flexgrid, and hence sum column 2?


    Thanks for your help

Post a reply

No one has replied yet! Why not be the first?

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.” - E. W. Dijkstra