简体   繁体   English

MS Access - 具有多个条件的过滤子表单

[英]MS Access - Filtering subform with multiple criteria

I'm trying to filter a subform from within a form with 2 criteria,我正在尝试从具有 2 个条件的表单中过滤子表单,
Both filters work independently but when I try and put them together I'm getting a 'Type Mismatch' error两个过滤器都独立工作,但是当我尝试将它们放在一起时,出现“类型不匹配”错误

Filter 1过滤器 1

Forms!Frm_Department_Job_List_22.[Qry_Department_Job_List_22 subform].Form.Filter = "[WIP] = True"
Forms!Frm_Department_Job_List_22.[Qry_Department_Job_List_22 subform].Form.FilterOn = True

Filter 2过滤器 2

Forms!Frm_Department_Job_List_22.[Qry_Department_Job_List_22 subform].Form.Filter = "[Customer Due Date] <=Date()"
Forms!Frm_Department_Job_List_22.[Qry_Department_Job_List_22 subform].Form.FilterOn = True

Together that doesn't work在一起是行不通的

 Forms!Frm_Department_Job_List_22.[Qry_Department_Job_List_22 subform].Form.Filter = ("[WIP] = True") And ("[Customer Due Date] <= Date()")
Forms!Frm_Department_Job_List_22.[Qry_Department_Job_List_22 subform].Form.FilterOn = True

Anyone any idea what's causing the error when nested together?任何人都知道嵌套在一起时导致错误的原因是什么?

Your filter expression, in fact, is logical conjunction on two expressions实际上,您的过滤器表达式是两个表达式的逻辑合取

("[WIP] = True") And ("[Customer Due Date] <= Date()")  

The result is Boolean "true/false".结果是 Boolean“真/假”。

Form.Filter require String, for example: Form.Filter需要字符串,例如:

"([WIP] = True) And ([Customer Due Date] <= Date())"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM