如果 TextBox 有 Cond,则 Bug 会重新启用它。格式化?

发布于 2024-10-31 00:39:56 字数 382 浏览 1 评论 0原文

我想我正在直接查看 Access 2003 的错误。这就是我所做的(我认为):

  1. 我正在开发一个连续表单(即每页多个记录)。
  2. 我在“详细信息”部分的背景中有一个未绑定的文本框。在数据属性下,我已启用=否,锁定=是。 (换句话说,我不希望用户选择它。我只希望它作为背景颜色)
  3. 此文本框还具有一些条件格式来更改该行的背景颜色。 (例如,如果我们有一段时间没有与该客户交谈,则该记录的背景为红色)
  4. 如果我选择条件格式处于活动状态的记录(即背景为红色),我实际上可以单击此文本框。当然,我无能为力,但这种情况不应该发生,而且肯定会让最终用户感到困惑。

还有其他人看过这个吗?你的解决方法是什么?

I think I'm looking directly at an Access 2003 bug. Here's what I did (I think):

  1. I'm developing a Continuous Form (i.e. multiple records per page).
  2. I have an unbound textbox in the background of the Details section. Under Data Properties, I have Enabled=No and Locked=Yes. (In other words, I don't want the user to select it. I only want it for the background color)
  3. This textbox also has some conditional formatting to change the background color for that row. (e.g. If we haven't spoken to that customer in awhile, the background for that record is red)
  4. If I choose a record where the conditional formatting is active (i.e. the background is red), I can actually click on this textbox. There's not much that I can do, of course, but this shouldn't happen and surely would be confusing to the end-users.

Has anyone else seen this? What's your workaround?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

她如夕阳 2024-11-07 00:39:56

Enabled 是一个可以通过条件格式控制的属性。默认情况下,当您添加新条件时,Enabled 属性设置为 True。 如果您不希望启用控件,则必须在条件格式规则中显式设置 Enabled = False。

该属性可通过条件格式对话框右下角的按钮进行切换。很容易错过(我总是忘记它)。

就我个人而言,我认为该属性应该是三向的:True、False 或 Inherit(以 Inherit 为默认值)。不幸的是,Access 强制您在添加条件格式规则时明确说明并说明该规则是否应使控件启用或禁用。

Enabled is a property that can be controlled via conditional formatting. By default when you add a new condition, the Enabled property is set to True. If you don't want your control to be enabled you must explicitly set Enabled = False within the conditional formatting rule.

The property is toggled via a button in the lower right corner of the conditional formatting dialog. It's easy to miss (I forget about it all the time).

Personally, I think the property should be three-way: True, False, or Inherit (with Inherit as the default). Unfortunately, Access forces you to be explicit when adding conditional formatting rules and state whether the rule should make the control Enabled or Disabled.

榕城若虚 2024-11-07 00:39:56

这是我的解决方法(我正在等待其他人是否会提出更好的建议。显然不会。)

  1. 在我的条件格式文本框中,为 GotFocus 添加一个事件过程。输入此代码:Me.Txt_FocusHere.SetFocus
  2. 在表单上的某处创建第二个未绑定文本框。将其缩小至只有 1 行粗。将其命名为 Txt_FocusHere

因此,每当用户单击彩色背景时,焦点就会立即转移到这个虚拟文本框,该文本框无法存储任何数据,而且很小,用户看不到闪烁的光标。

Here's my workaround (I was waiting to see if anyone else would suggest something better. Apparently not.)

  1. In my conditionally formatted textbox, add an Event Procedure for GotFocus. Enter this code: Me.Txt_FocusHere.SetFocus.
  2. Make a 2nd unbound text box somewhere on the form. Shrink it until it's just 1 line thick. Call it Txt_FocusHere.

So whenever the user clicks on the colored background, the focus is immediately taken to this dummy textbox which can't store any data and is so small that the user doesn't see the blinking cursor.

叫思念不要吵 2024-11-07 00:39:56

我成功地使用了以下页面上的方法: http://www.mvps.org/access /forms/frm0047.htm - “以连续形式更改当前记录的背景颜色”

I successfully used the method on the following page: http://www.mvps.org/access/forms/frm0047.htm - "Changing the Background Color of the Current Record in a Continuous Form"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文