在 Access 2007/2010 中启用和禁用对连续子窗体的控制 [英] Enabling and disabling controls on a Continuous Subform in Access 2007/2010
问题描述
我需要启用或禁用依赖于另一个字段的连续子表单上的控件.我由本能编写的初始代码与建议的非常相似 此处,但它不仅禁用标记为子"的控件,还禁用所有控件 - 实际上,它似乎只是在寻找最后一条记录的值并影响所有行.
I need to enable or disable a control on a continuous subform, dependent on another field. The initial code I wrote by instinct was very similar to what is suggested here, but instead of only disabling those controls which are marked as "child", it disables all of them - in effect, it seems only to be looking for the value of the last record and affecting all the rows.
有没有办法做到这一点,或者我是在吠错树?代码如下:
Is there a way this can be achieved, or am I barking up the wrong tree? Code below:
If Me.Record_Type = "Child" Then 'Disable subsidiary records
Me.Record_Type.SetFocus
Me.Prospect_Name.Enabled = False
End If
推荐答案
以连续形式处理行的唯一方法是使用 条件格式.任何应用的代码都指向活动行,因此它似乎会影响所有行.
The only way of sensibly working with rows in a continuous form is with Conditional Formatting. Any code applied refers to the active row, and so it appears to affect all rows.
条件格式,Access 2010
选择启用/禁用
这篇关于在 Access 2007/2010 中启用和禁用对连续子窗体的控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!