因为我的条件格式化语句似乎太大了:
([Panels] like '*IT_AMPH,*' or [Panels] like '*AMPH_SN,*' or [Panels] like '*AMPH_S,*') and
([Panels] like '*IT_BARB,*' or [Panels] like '*BARB_SN,*' or [Panels] like '*BARB_S,*') and
([Panels] like '*IT_BENZ,*' or [Panels] like '*BENZ_SN,*' or [Panels] like '*BENZ_S,*') and
([Panels] like '*IT_BUP,*' or [Panels] like '*BUP_SN,*' or [Panels] like '*BUP_S,*') and
([Panels] like '*IT_SOMA,*' or [Panels] like '*SOMA_SN,*' or [Panels] like '*SOMA_S,*') and
([Panels] like '*IT_FEN,*' or [Panels] like '*FEN_SN,*' or [Panels] like '*FEN_S,*') and
([Panels] like '*IT_MEP,*' or [Panels] like '*MEP_SN,*' or [Panels] like '*MEP_S,*') and
([Panels] like '*IT_METD,*' or [Panels] like '*METD_SN,*' or [Panels] like '*METD_S,*') and
([Panels] like '*MPH,*') and
([Panels] like '*IT_OPIA,*' or [Panels] like '*OPIA_SN,*' or [Panels] like '*OPIA_S,*') and
([Panels] like '*IT_OXYC,*' or [Panels] like '*OXY_SN,*' or [Panels] like '*OXY_S,*') and
([Panels] like '*IT_PROPX,*' or [Panels] like '*PROPX_SN,*' or [Panels] like '*PROPX_S,*') and
([Panels] like '*TAP,*' or [Panels] like '*TAP_SN,*' or [Panels] like '*TAP_S,*') and
([Panels] like '*IT_TRAM,*' or [Panels] like '*TRAM_SN,*' or [Panels] like '*TRAM_S,*') and
([Panels] like '*IT_TCA,*' or [Panels] like '*TCA_SN,*' or [Panels] like '*TCA_S,*') and
([Panels] like '*IT_COCN,*' or [Panels] like '*COCN_SN,*' or [Panels] like '*COCN_S,*') and
([Panels] like '*IT_6-MAM,*' or [Panels] like '*6-MAM_SN,*' or [Panels] like '*6-MAM_S,*') and
([Panels] like '*IT_MDMA,*' or [Panels] like '*MDMA_SN,*' or [Panels] like '*MDMA_S,*') and
([Panels] like '*IT_PCP,*' or [Panels] like '*PCP_SN,*' or [Panels] like '*PCP_S,*') and
([Panels] like '*IT_THC50,*' or [Panels] like '*THC_SN,*' or [Panels] like '*THC_S,*') and
([Panels] like '*ETOH_S,*' or [Panels] like '*ETOH,*') and
([Panels] like '*NIC,*') and
([Panels] like '*IT_ETG,*' or [Panels] like '*ETG_SN,*' or [Panels] like '*ETG_S,*')我在想,也许我应该做一条IF语句,而不是条件格式。例如,如果上述语句为真,则将文本框字体颜色设置为黑色
我的问题是它能行得通吗?
如果我在上面的语句上对Report_Load执行一条IF语句,它会像条件格式一样工作吗?
如果是这样,那我该怎么做呢?请给我一些代码好吗?
发布于 2010-07-08 00:23:40
考虑在隐藏文本框的表达式中使用复杂条件。然后,可以在简化的条件格式设置规则中引用隐藏的文本框。
我将txtStatus创建为一个隐藏的文本框,并使用以下表达式作为其控件源(foo_text是窗体记录源中的一个字段):
=IIf([foo_text] Like 'child*',1,0)然后,对于我显示的文本框,我添加了一个条件"Expression Is“for:
[txtStatus]>0..。并在条件为True时为文本属性指定红色。
也许一个类似的方法可以为你工作。
https://stackoverflow.com/questions/3196707
复制相似问题