Pass a parameter into an access report programmatically

前端 未结 5 1013
逝去的感伤
逝去的感伤 2020-12-03 14:33

I\'ve got an existing Access MDB. I\'m adding a command button to an existing Form that runs an existing report. The change being made is that this button needs to pass in

5条回答
  •  佛祖请我去吃肉
    2020-12-03 15:08

    The Where clause of the docmd.openreport is a string that uses the same format as the where clause in a SQL statement.

    The reason to put parameterize you query at the docmd instead of the RecordSource of the report is flexibility. You may have a need to open the report without any paremeter/return all the records or have the ability to filter on different fields.

提交回复
热议问题