条件格式 [英] Conditional Formatting
问题描述
你好
有没有办法在文本框的条件格式中使用变量?
示例:
我想要一个连续形式的文本框的背景来改变颜色
MyField1的值。是真的。
没问题,我只需要写表达就是。和条件格式的[MyField1] = -1
。
但是,如果不是MyField1,那该怎么办?我想使用具有
焦点的字段。
所以如果MyField2有条件格式化需要关注的重点是
Expression is和[MyField2] = -1
我写了一个函数(FieldName()),它返回了具有焦点的字段名称
但我无法正确
写条件格式化访问此功能。
这不起作用[FieldName()] = -1
如何编写条件格式,以便函数FieldName()
可以插入字段的名称
表达式中[]之间的焦点是?
我正在使用Access 2000
谢谢
G. Gerard >
在条件格式表达式中,尝试:
[Form]。[ActiveControl]
-
Allen Browne - 微软MVP。西澳大利亚州珀斯。
访问用户提示 - http:// allenbrowne.com/tips.html
回复群组,而不是mvps dot org的allenbrowne。
" GGerard" < GG ***** @ nbnet.nb.ca>在消息中写道
news:cF ********************** @ ursa-nb00s0.nbnet.nb.ca ... < blockquote class =post_quotes>
有没有办法在
文本框的条件格式中使用变量?
示例:
我希望文本框的背景以连续的形式改变颜色
当MyField1的值为MyField1时。是的。
没问题,我只需要写表达就是。和[MyField1] = -1
在条件格式中。
但如果不是MyField1,那该怎么办呢?我想使用具有
焦点的字段。
因此,如果MyField2有条件格式化需要关注的重点是表达式。和[MyField2] = -1
我写了一个函数(FieldName()),它返回具有焦点的字段名称
但我无法正确
这不起作用[FieldName()] = -1
如何编写条件格式以便函数
FieldName()可以插入字段的名称
,表达式中的[]之间的焦点是?
我正在使用Access 2000
<谢谢
G. Gerard
Hello
Is there a way to use a variable in the Conditional Formatting of a Textbox?
Example :
I want the background of a textbox in a continuous form to change color when
the value of "MyField1" is True.
No problem, I just need to write "Expression is" and "[MyField1] = -1 "
in the Conditional Formatting.
But what if instead of "MyField1" I want to use the field that has the
focus.
So if "MyField2" has the focus the Conditional Formatting would need to be
"Expression is" and "[MyField2] = -1
I have written a Function (FieldName()) that returns the name of the field
that has the focus but I am unable the correctly
write the Conditional Formatting the access this function.
This doesn''t work [FieldName()] = -1
How can I write the Conditional Formatting so that the function FieldName()
can insert the name of the field
that has the focus between the [ ] in Expression is?
I am using Access 2000
Thanks
G. Gerard
In your conditional formatting expression, try:
[Form].[ActiveControl]
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"GGerard" <gg*****@nbnet.nb.ca> wrote in message
news:cF**********************@ursa-nb00s0.nbnet.nb.ca...
Is there a way to use a variable in the Conditional Formatting of a
Textbox?
Example :
I want the background of a textbox in a continuous form to change color
when the value of "MyField1" is True.
No problem, I just need to write "Expression is" and "[MyField1] = -1
" in the Conditional Formatting.
But what if instead of "MyField1" I want to use the field that has the
focus.
So if "MyField2" has the focus the Conditional Formatting would need to be
"Expression is" and "[MyField2] = -1
I have written a Function (FieldName()) that returns the name of the field
that has the focus but I am unable the correctly
write the Conditional Formatting the access this function.
This doesn''t work [FieldName()] = -1
How can I write the Conditional Formatting so that the function
FieldName() can insert the name of the field
that has the focus between the [ ] in Expression is?
I am using Access 2000
Thanks
G. Gerard
这篇关于条件格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!