Hi Thierry,
One other item that may be of interest: if you want to have your expression
display the total number of records *before* the user applies the filter
(but after a query is executed) and then change to the number of records
shown on the form *after* the filter is applied, here is how you could
accomplish that behavior:
- Have one field that has the expression:
count(dfs:dataFields/d:Orders[@OrderID != ""])
** NOTE: In my sample, OrderID is one of the fields in my Repeating
Section. If you don't use this type of clause, then the expression will
show a count of 1 when the form is initially opened.
- Have another field with the expression I provided in my prior post:
count(dfs:dataFields/d:Orders[@ShipVia = //dfs:myFields/my:txtCity])
- Add "Conditional Formatting" to each of these fields similar to the
following:
- For the first field noted above, I have an expression that is basically:
if the count of my "Orders" group > 0 then hide this field
- For the second field noted above, I have an expression that checks to
see if my filter drop-down box "is blank" - if so, I hide this field.
Both of these fields are next to each other on my form so only one gets
displayed at a time. So when I initially open my form, the filter box is
empty and the count of my "Orders" is 0 so the first field is displayed
with a value of 0. Once I execute a query to return records, the count of
my "Orders" is now > 0 so I still show the first field but with the total
number of records returned. Lastly, once I apply a filter, my filter
drop-down box is no longer "blank" so my first count box is now hidden and
the second is made visible with a total of just the filtered records!
Whew...I hope all this makes sense!!
Best Regards,
Scott L. Heim
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.