Enabling and disabling controls on a Continuous Subform in Access 2007/2010

╄→гoц情女王★ 提交于 2019-11-26 17:15:16

问题


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

回答1:


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.

Conditional Formatting, Access 2010

Enable / Disable is selected



来源:https://stackoverflow.com/questions/11507151/enabling-and-disabling-controls-on-a-continuous-subform-in-access-2007-2010

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!