基于组合框的通配符不起作用 [英] Wild card based on combo box not working

查看:94
本文介绍了基于组合框的通配符不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在查询中有一个条件,无法完全满足要求:

I've got a criteria within a query, can't quite get it to work:

IIf([Forms]![Reports]![Office Filter]<>"View all offices",[Forms]![Reports]![Office Filter],"LIKE '*'")

查询的目的是检查是否选择了办公室。如果是这样,则应将该标准设置为该办公室。如果不是这样,即如果从报表表单的组合框中选择查看所有办公室,则它应显示所有记录。

The purpose of the query is to check if an office is selected. If so, the criteria should be set to that office. If not, i.e. if "View all offices" is selected from the combobox on the Reports form, it should show all records.

如果选择了办公室,则查询工作正常,但如果选择了查看所有办公室,则不返回任何记录。我已尝试将此术语作为一个单独的表达式放入,以检查其是否正常运行-至少在查看所有办公室表达式中返回Like '*'

The query works fine if an office is selected, but returns no records if "View all offices" is selected. I've tried putting this term in as a separate expression to check that it's working - at least as far as returning Like '*' in the expression when "View all offices" is selected.

关于我在做什么错的任何线索吗?

Any clue as to what I'm doing wrong? Thanks in advance.

推荐答案

请尝试以下操作:

WHERE ([Forms]![Reports]![Office Filter]="View all offices") OR (OfficeField=[Forms]![Reports]![Office Filter])

这篇关于基于组合框的通配符不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆