连续窗体视图中的不同未绑定控件 [英] Different unbound controls in continuous form view

查看:126
本文介绍了连续窗体视图中的不同未绑定控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法让未绑定的,未计算的控件(或基于函数的计算控件)为每条记录保留不同的值?

Is there a way to have unbound, uncalculated controls (or a calculated control that is based on a function) that retains a different value for each record?

推荐答案

不!你怎么能?如果没有存储(绑定)到特定记录,你怎么能指望Access知道你放在它里面的价值?所有未绑定的控件都包含已在控件的任何实例中输入的最新数据。在连续视图表单中,您可以看到这一点。如果它是一个未绑定的控件并保存一个计算值并且表单是单一视图形式,您可以作弊并使其显示为每个控件保留不同的值记录,通过在记录之间移动时重新计算。但实际上,当RecordA上的控件保持10时,此控件的所有实例都保持10,你只能看不到控件的其他实例。


欢迎来到 Bytes


Linq ; 0)>
No! How could you? How could you expect Access to know what value you''ve placed in it if it''s not stored (bound) to that particular record? All unbound controls hold the latest data that''s been entered in any of the instances of the control. In a Continuous View form, you can see this. If it''s an unbound control and holds a calculated value and the form is in Single View form, you can cheat and make it appear to hold a different value for each record, by re-calculating it as you move from record to record. But in actuality when the control on RecordA holds 10, all instances of this control hold 10, you just can''t see the other instances of the control.

Welcome to Bytes!

Linq ;0)>


快速回复!

我不明白这个问题,怎么可能不是这样。记住不同记录中的状态是有意义的。事件总是从特定记录生成,因此修改控件状态的任何代码显然都意味着修改该记录的状态。如果用户直接修改控件,他肯定意味着修改他与之交互的那个!选中字段旁边的复选框应该允许触发将对该记录执行某些操作的代码!没有人希望看到附近的所有复选框突然弹出或关闭!

无论如何,足够的哲学家。也许你可以帮我解决我的具体问题。

订单是根据订单的多个组件,方面来定价的。默认情况下,价格是根据库存表计算的,但应允许用户覆盖它并输入当前订单的自定义价格。由于官方价格必须存储在任何一种情况下,以便在选择时可以恢复到官方价格,自定义价格必须存在于单独的字段中,设置为空以表示它是常规价格正在使用的价格。我宁愿没有额外的字段来存储价格是否已定制。这应该根据自定义字段是否为空来确定。

某些价格组件是从表中选择的行,因此发票的一部分是column是一个子窗体,显然以连续的窗体视图显示,因此您可以一次看到价格的所有组件。

问题是用户界面不应该需要两列字段。当价格定制时,你不应该看到真正的价格,当它不是你肯定不需要看到空文本框。

理想的方法是有一个复选框切换单个文本框的控件源。显然,这是不可能的。
What a quick response!
I don''t understand the question, "how could it be otherwise." It would make sense to remember state across different records. Events are always generated from a specific record, so any code modifying a control''s state obviously means to modify that state for that record. And if the user directly modifies the control he certainly means to modify the one he interacted with! Checking a checkbox next to a field should be allowed to trigger code that will perform some operation on that record! No one expects to see all the check boxes nearby to suddenly pop on or off!
Anyway, enough philosophising. Maybe you can help me with my specific problem.
An order is priced based on a number of components, aspects of the order. The price by default is calculated from the inventory tables, but the user should be allowed to override it and enter a custom price for the current order. Since the official price must be stored in either case so that it''s possible to revert to the official price at the time of selection, the custom price must exist in separate field, set to null to indicate that it''s the regular price that''s being used. I''d rather not have an extra field just to store whether or not the price has been customized. That should be determined from whether the custom field is null.
Some of the price components are rows selected from a table, so part of the "invoice" column is a subform, displayed in continuous form view obviously, so you can see all the components of the price at once.
The problem is that the user interface should not require two columns of fields. When the price is customized you should not see the real price, and when it''s not you certainly don''t need to see the empty text box.
The ideal way would be to have a check box which toggles the control source of a single text box. Apparently that''s impossible.


现在我尝试为每个文本框切换文本框并将它们切换为可见/不可见(实际价格可见,双击将其设置为不可见且自定义可见,更新后更新null设置自定义隐形和实际价格可见)。你猜怎么着?同样,设置适用于每条记录!想法,任何人??
Now I tried having text boxes for each and toggling them visible/invisible (real price is visible, double-click sets it invisible and custom visible, afterupdate with null sets custom invisible and real price visible). Guess what? Again, settings apply for every record! Ideas, anyone??


这篇关于连续窗体视图中的不同未绑定控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆