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
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).