Wednesday, June 09, 2010

Access Web Services : form filtering and sorting

If you setup a form based on a table source and then add in the forms properties to sort and filter, when you add this form to a Navigation page it completely disregards what you have entered in the forms properties and  just uses the default sort for the table with all values - Brilliant Microsoft!



Filter and Order By Properties  get ignored.


So to get around this for sorting you need to write a query on your table that has the data sorted in the format you require.  Then change the form to use the query instead of the table and that’s sorting sorted out.

But what about filtering?

Well on the tab for a navigation page there is a property called "Navigation Where Clause"  if you put your where statement in there Microsoft actually uses this filter in the way you would expect and doesn’t ignore it as before.  Wonderful!

Navigation Where Clause's do  work

4 comments:

Vern said...

Thanks for the info. I will add it to my treasure chest.

Vern said...

Thanks for the info. I will add it to my treasure chest.

Vern said...

Thanks for the info.

Anonymous said...

How about when the form has a subform and you want to filter on the records on the subform? The 'Navigation Where Clause' does not work in this case.

For instance, in Microsoft's sample 'Contacts Database', if the above filter does not work on the Contacts form in the Navigation form. Please help