Form load and filter question

前端 未结 4 752
星月不相逢
星月不相逢 2021-01-21 06:51

I\'m doing a search form. On top, there are several comboboxes for users to choose a combination of criterias. Then I construct a Where string to filter a sub form displaying th

4条回答
  •  滥情空心
    2021-01-21 07:26

    An alternative is one that I often use, which is to save the subform with a recordsource that produces one blank, uneditable record. The SQL I usually use is something like this:

      SELECT TOP 1 Null As Field1, Null As Field2, 0 As Field3
      FROM MyTable;
    

    This displays one blank record with Nulls for some fields, 0 for others (as appropriate). I find it cosmetically more attractive than the alternative.

    When I'm ready to display a filtered set, I change the Recordsource instead of setting a filter.

提交回复
热议问题