• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3885
  • Last Modified:

msflexgrid row count

Is there a way no matter how I populate an msflexgrid to get the actual row count Excluding Null rows put into a label?
fordraiders
0
Fordraiders
Asked:
Fordraiders
  • 3
  • 2
1 Solution
 
FordraidersAuthor Commented:
To All,
I have the following working but is not getting rid of null rows.
lblRecordCount is the Label on the form.


lblRecordCount = MsFlexgrid1.rows -1

The minus one is for the first row header.
fordraiders
0
 
TimCotteeCommented:
Hi David: how are things?

Short of going through each row and determining whether it has valid data, incrementing a counter if it has there is no easy way of doing this that I can think of.
0
 
FordraidersAuthor Commented:
Tim,
Things are going well!
Thank You.

The count is for the Populategrids routine.
After the return in Msflexgrid1 from all three databases. I was trying to count the number of non-Null rows in the return.

Other than using the statement Above.
I have yet to get a total accurate count,
Because of null rows.
fordraiders
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
TimCotteeCommented:
David:

The following code will give the number of non-null records in the flexgrid:

iif(rstStorage.RecordCount >0,rstStorage.RecordCount ,0) + iif(rstStorage2.RecordCount >0,rstStorage2.RecordCount ,0) + iif(rstStorage3.RecordCount >0,rstStorage3.RecordCount ,0)

You need to use this immediately before each Exit Function line in the populategrids routine to update the label's caption with the value.
0
 
FordraidersAuthor Commented:
Tim,
This interesting.
I tried.

lblrecordcount = rstStorage.RecordCount + rstStorage2.RecordCount +
rstStorage3.RecordCount

But it didn't work.
Will give it a whirl.

Didn't think about going with the IIF.
Now that I think about it.
I used the IIF quite abit when I Used Access97-vba on another project.

I also added at the beginning of each function.
dim  lblString as string
lblstring = "Records Returned"
lblReturn.Caption =  lblString

Just so I wouldn't have to repeat it at the end of each
Exit Function

Your the best.
Thanks again for the attention.
fordraiders
0
 
Wilder1626Commented:
but i only look in column 39, so it should only be 114331. Right?
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now