iif查询条件中的函数 [英] iif Function in query criteria

查看:106
本文介绍了iif查询条件中的函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于选择查询构建一个表单,其中包含一个组合框(3个选项)

表单标题,它将为查询提供一个值。在

查询的标准中,我添加了以下表达式 - [Forms]![Form_1]!

[Combo_1],这就像一个魅力。但是我的一个用户希望在选择三个

选项之一之前看到所有值。


我添加了选择全部到我的组合下拉列表,并尝试按照iif语句后的

作为标准:

iff([Forms]![Form_1]![Combo_1] =" All",喜欢*,[Forms]![Form_1]!

[Combo_1])


我原来的3个选择仍然有用,但不是我的所有的" ;.我曾尝试过Like

*",Is Not Null和*但似乎没什么用。


有什么建议吗?

Built a form based on a select query with a combo box (3 choices) in
the form header which will supply a value to the query. In the
query''s criteria I added the following expression - [Forms]![Form_1]!
[Combo_1] and this works like a charm. However one of my users wanted
to see all of the values before choosing one of the three
selections.

I added the choice "All" to my combo dropdown list and tried the
following iif statement as the criteria:
iff([Forms]![Form_1]![Combo_1]="All",Like "*",[Forms]![Form_1]!
[Combo_1])

My original 3 choices still work but not my "All". I have tried "Like
"*"", "Is Not Null" and "*" but nothing seems to work.

Any suggestions?

推荐答案

WU10写道:
WU10 wrote:

构建一个基于选择查询的表单,其中包含一个组合框(3个选项)

表格标题,它将为查询。在

查询的标准中,我添加了以下表达式 - [Forms]![Form_1]!

[Combo_1],这就像一个魅力。但是我的一个用户希望在选择三个

选项之一之前看到所有值。


我添加了选择全部到我的组合下拉列表,并尝试按照iif语句后的

作为标准:

iff([Forms]![Form_1]![Combo_1] =" All",喜欢*,[Forms]![Form_1]!

[Combo_1])


我原来的3个选择仍然有用,但不是我的所有的" ;.我曾尝试过Like

*",Is Not Null和*但似乎没什么用。


有什么建议吗?
Built a form based on a select query with a combo box (3 choices) in
the form header which will supply a value to the query. In the
query''s criteria I added the following expression - [Forms]![Form_1]!
[Combo_1] and this works like a charm. However one of my users wanted
to see all of the values before choosing one of the three
selections.

I added the choice "All" to my combo dropdown list and tried the
following iif statement as the criteria:
iff([Forms]![Form_1]![Combo_1]="All",Like "*",[Forms]![Form_1]!
[Combo_1])

My original 3 choices still work but not my "All". I have tried "Like
"*"", "Is Not Null" and "*" but nothing seems to work.

Any suggestions?



[表格]![Form_1]![Combo_1]


....然后在下一个下标准行......


[表格]![Form_1]![Combo_1] =" All"


-

Rick Brandt,Microsoft Access MVP

电子邮件(视情况而定)至...

在Hunter dot com的RBrandt

[Forms]![Form_1]![Combo_1]

....and then under that on the next criteria row...

[Forms]![Form_1]![Combo_1] = "All"

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


6月2日下午1:01,Rick Brandt < rickbran ... @ hotmail.comwrote:
On Jun 2, 1:01 pm, "Rick Brandt" <rickbran...@hotmail.comwrote:

WU10写道:
WU10 wrote:

建立一个基于表单在一个带有组合框(3个选项)的选择查询中,

表单标题将为查询提供一个值。在

查询的标准中,我添加了以下表达式 - [Forms]![Form_1]!

[Combo_1],这就像一个魅力。但是我的一个用户希望在选择三个

选项之一之前看到所有值。


Built a form based on a select query with a combo box (3 choices) in
the form header which will supply a value to the query. In the
query''s criteria I added the following expression - [Forms]![Form_1]!
[Combo_1] and this works like a charm. However one of my users wanted
to see all of the values before choosing one of the three
selections.


我添加了选项All到我的组合下拉列表,并尝试按照iif语句后的

作为标准:

iff([Forms]![Form_1]![Combo_1] =" All",喜欢*,[Forms]![Form_1]!

[Combo_1])$ ​​b $ b
I added the choice "All" to my combo dropdown list and tried the
following iif statement as the criteria:
iff([Forms]![Form_1]![Combo_1]="All",Like "*",[Forms]![Form_1]!
[Combo_1])


我原来的3选择仍然有效但不是我的全部。我曾尝试过Like

*",Is Not Null和*但似乎没什么用。
My original 3 choices still work but not my "All". I have tried "Like
"*"", "Is Not Null" and "*" but nothing seems to work.


有什么建议吗?
Any suggestions?



[表格]![Form_1]![Combo_1]


...然后根据下一个标准排...


[表格]![Form_1]![Combo_1] =" All"


-

Rick Brandt,Microsoft Access MVP

电子邮件(视情况而定)至...

在Hunter dot com的RBrandt-隐藏引用的文字 -


- 显示引用的文字 -


[Forms]![Form_1]![Combo_1]

...and then under that on the next criteria row...

[Forms]![Form_1]![Combo_1] = "All"

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com- Hide quoted text -

- Show quoted text -



Rick,


我应该忘记IIF声明并使用

建议的下一个标准?

Rick,

Should I forget the IIF statement and use the next criteria as you
suggest?


WU10写道:
WU10 wrote:

6月2日下午1:01,Rick Brandt < rickbran ... @ hotmail.comwrote:
On Jun 2, 1:01 pm, "Rick Brandt" <rickbran...@hotmail.comwrote:

WU10写道:
WU10 wrote:

建立一个基于表单在一个带有组合框的选择查询(3个选项)

表格标题中,它将为查询提供一个值。在

查询的标准中,我添加了以下表达式 -

[Forms]![Form_1]! [Combo_1]这就像一个魅力。然而

我的一个用户希望在选择

之前看到所有值,这是B / B
选项中的一个。
Built a form based on a select query with a combo box (3 choices)
in the form header which will supply a value to the query. In the
query''s criteria I added the following expression -
[Forms]![Form_1]! [Combo_1] and this works like a charm. However
one of my users wanted to see all of the values before choosing
one of the three
selections.


我添加了选项All到我的组合下拉列表,并尝试按照iif语句后的

作为标准:

iff([Forms]![Form_1]![Combo_1] =" All",喜欢*,[Forms]![Form_1]!

[Combo_1])$ ​​b $ b
I added the choice "All" to my combo dropdown list and tried the
following iif statement as the criteria:
iff([Forms]![Form_1]![Combo_1]="All",Like "*",[Forms]![Form_1]!
[Combo_1])


我原来的3选择仍然有效但不是我的全部。我试过

" Like" *""," Is Not Null"和*但似乎没什么用。
My original 3 choices still work but not my "All". I have tried
"Like "*"", "Is Not Null" and "*" but nothing seems to work.


有什么建议吗?
Any suggestions?



[表格]![Form_1]![Combo_1]


...然后根据下一个标准排...


[表格]![Form_1]![Combo_1] =" All"


-

Rick Brandt,Microsoft Access MVP

电子邮件(视情况而定)至...

在Hunter dot com的RBrandt-隐藏引用的文字 -


- 显示引用的文字 -

[Forms]![Form_1]![Combo_1]

...and then under that on the next criteria row...

[Forms]![Form_1]![Combo_1] = "All"

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com- Hide quoted text -

- Show quoted text -



Rick,


我应该忘记IIF声明并使用

建议的下一个标准是什么?


Rick,

Should I forget the IIF statement and use the next criteria as you
suggest?



是的。


-

Rick Brandt,Microsoft Access MVP

电子邮件(视情况而定)至...

在Hunter dot com的RBrandt

Yes.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


这篇关于iif查询条件中的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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