使用另一个表自动填充表单中的复选框 [英] Autofilling Checkboxes in a Form using another table

查看:59
本文介绍了使用另一个表自动填充表单中的复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户表,其中有几个复选框字段。

我还有一个带有相同复选框字段的订单表(虽然名称略有不同)。

这不是双重的,因为我只在customers表中有这些字段来定义客户的首选项。这些默认首选项可能不适用于他们的每个订单。


我遇到的麻烦是通过表单将真/假信息传递到订单表。表单的数据源是订单表。我在该订单表上分配给其字段的表单上有复选框。我想要的是当用户进入客户时,我希望(在更新事件上)根据客户表的复选框字段自动填充复选框,其中客户名称与他们刚输入的内容相匹配。

我错过了一些简单的东西吗?


谢谢

解决方案


...

这不是双重的,因为我只在customers表中有这些字段来定义客户的偏好。这些默认首选项可能不适用于他们的每个订单。

...



我怀疑你的意思是重复(duplicitous是欺骗或虚伪)。


不是特别相关,但我认为我会把它作为奖励扔掉;)


PS。我理解你的意思以及为什么这是一种完全有效的数据管理方式。


...

我遇到的问题获取真/假信息通过表单传递到订单表。表单的数据源是订单表。我在该订单表上分配给其字段的表单上有复选框。我想要的是当用户进入客户时,我希望(在更新事件上)根据客户表的复选框字段自动填充复选框,其中客户名称与他们刚输入的内容相匹配。

我错过了一些简单的东西吗?


谢谢



简单?可能不是。


您需要做的是在添加新订单时以及仅在何时添加新订单时从客户记录中获取默认值。一旦为订单设置了项目,或者之后在该订单上更改了该项目,则使用默认值覆盖该信息是不合适的。


我会考虑以下两种方法之一: ol style =list-style-type:decimal>

  • 如果当前表单只显示来自一个客户的订单记录,那么您可以在表单初始化时或者在表单时更改相关控件的默认值如果在打开后更改过滤器值,则更改过滤器。
  • 否则(显示的订单与多个客户有关),使用BeforeInsert事件触发设置值,因为它们应该是希望这有帮助。


  • 我怀疑你的意思是重复(duplicitous是欺骗或者虚伪。


    不是特别相关,但我以为我会把它作为奖励扔掉;)


    PS。我理解您的意思以及为什么这是一种完全有效的数据管理方式。



    是的,你是对的。 :-)

    实际上两者都可以申请,因为有时候我认为Access有自己的偏差。


    简单?可能不是。


    您需要做的是在添加新订单时以及仅在何时添加新订单时从客户记录中获取默认值。一旦为订单设置了项目,或者之后在该订单上更改了该项目,则使用默认值覆盖该信息是不合适的。


    我会考虑以下两种方法之一: ol style =list-style-type:decimal>
  • 如果当前表单只显示来自一个客户的订单记录,那么您可以在表单初始化时或者在表单时更改相关控件的默认值如果在打开后更改过滤器值,则更改过滤器。
  • 否则(显示的订单与多个客户有关),使用BeforeInsert事件触发设置值,因为它们应该是。
  • 希望这会有所帮助。



    我有不同用途的单独表格。我有一个表单用于输入新订单,另一个表单用于查看现有订单(不允许编辑)。我还有一个用于编辑现有订单的表单。


    我想要查找客户默认首选项的唯一表单是添加新订单表单。基本上,我不想在每次输入订单时单击两个复选框,我希望它们根据客户的默认首选项自动填写。但是,如果由于某种原因,他们不适用于特定的订单,我希望能够取消选中这些框。


    其中一个复选框的示例:我们有标题公司可以让我们将他们的标识放在我们的调查板上。并非所有的冠军公司都想要这样也有可能他们不希望在特定的订单上,但在大多数情况下。那么Logo?复选框应默认为是但不要被卡住。复选框不应默认为是。对于某些产权公司,如果他们几乎从不想要这个标识。


    订购者 field是Add New Orders表单上的一个组合框,由Customers表填充(为方便起见,因为我们的大多数订单来自常规客户)。因此,当用户键入或选择Customers表中的IS公司名称时,我希望它查找Customers表中的复选框字段并自动填写表单中的复选框(即在Orders表中)。我希望它发生在Ordered By字段的On Update事件上,而不是其他地方(就像你说的那样,它不会在以后重置我所做的任何更改)。


    我无法弄清楚实现这一目标的程序。


    PS在表单上确实没有应用过滤器,除了它只是一个数据输入表单,所以它不加载现有的订单。


    我听到你,但除了你有的事实添加订单的专用表单我没有看到任何我还没有说过的内容。同时它没有具体确认我所说的,因为它使用了不同的措辞。


    我会说On Update事件可能不合适,因为这不会显示在提交表单之前对用户的更改。


    我仍​​然不确定是否可以通过在表单初始化时设置默认值来完成此操作说没有应用过滤器。您不会评论数据是否可以保证专门针对特定客户。


    如果这种方法合适,它肯定是最符合您需求的。

    I have a customers table that has a couple of checkbox fields.
    I also have an orders table with those same checkbox fields (though with a slightly different name).
    This is not duplicitous as I only have those fields in the customers table to define a customer''s preferences. Those default preferences may not apply to every order from them.

    What I am having trouble with is getting the true/false info to pass on to the orders table via the form. The form''s data source is the orders table. I have checkboxes on the form assigned to their fields on that orders table. What I want is when the user enters the customer, I want ("on update event") the checkboxes to autofill according the checkbox field of the customers table where the customer name matches what they just entered.

    Am I missing something simple?

    Thanks

    解决方案

    ...
    This is not duplicitous as I only have those fields in the customers table to define a customer''s preferences. Those default preferences may not apply to every order from them.
    ...

    I suspect you mean duplication ("duplicitous" is "deceiving" or "mendacious").

    Not particularly relevant but I thought I''d throw it in as a bonus ;)

    PS. I understand your meaning and why this is a perfectly valid way of managing your data.

    ...
    What I am having trouble with is getting the true/false info to pass on to the orders table via the form. The form''s data source is the orders table. I have checkboxes on the form assigned to their fields on that orders table. What I want is when the user enters the customer, I want ("on update event") the checkboxes to autofill according the checkbox field of the customers table where the customer name matches what they just entered.

    Am I missing something simple?

    Thanks

    Simple? Possibly not.

    What you need to do is to grab the default values from the Customer record when, and ONLY when, a new order is added. Once the item has been set for an order, or afterwards changed on that order, it is not appropriate to overwrite that info with the defaults.

    I would consider one of two approaches :

    1. If the current form shows only order records from the one customer, then you can change the default values of the relevant controls either when the form is initialised, or when the filter is changed if you do change filter values after it''s opened.
    2. Otherwise (orders are shown that pertain to more than one customer), use the BeforeInsert event to trigger setting the values as they should be.

    Hope this helps.


    I suspect you mean duplication ("duplicitous" is "deceiving" or "mendacious").

    Not particularly relevant but I thought I''d throw it in as a bonus ;)

    PS. I understand your meaning and why this is a perfectly valid way of managing your data.

    Yes you are right. :-)
    Actually both could apply because sometimes I think Access has a deviant mind of its own.

    Simple? Possibly not.

    What you need to do is to grab the default values from the Customer record when, and ONLY when, a new order is added. Once the item has been set for an order, or afterwards changed on that order, it is not appropriate to overwrite that info with the defaults.

    I would consider one of two approaches :

    1. If the current form shows only order records from the one customer, then you can change the default values of the relevant controls either when the form is initialised, or when the filter is changed if you do change filter values after it''s opened.
    2. Otherwise (orders are shown that pertain to more than one customer), use the BeforeInsert event to trigger setting the values as they should be.

    Hope this helps.

    I have seperate forms for different uses. I have one form for entering new orders, and another form for viewing existing orders (does not allow editing). I also have a form for editing existing orders.

    The only form that I want to lookup the customer''s default preferences is the Add New Orders form. Basically, I don''t want to have to click the two checkboxes every time I enter an order, I want them filled automatically based on the customer''s default preference. But I want to be able to uncheck the boxes if, for some reason, they don''t apply to a particular order.

    An example of one of the check boxes: we have an option for title companies to have us put their logo on our survey plats. Not all title companies want that. It is also possible that they won''t want it on a particular order, but will on most. So the "Logo?" check box should default to "yes" but not be stuck that way. The check box should NOT default to "yes" for certain title companies if they almost never want the logo.

    The "Ordered By" field is a combo box on the Add New Orders form, which is populated by the Customers table (for convenience, as most of our orders come from regular clients). So when the user types or selects a company name that IS in the Customers table, then I want it to lookup the checkbox fields in the Customers table and automatically fill the checkboxes in my form (i.e. in the Orders table). I would like it to happen on the On Update event for the Ordered By field, and nowhere else (that way, like you said, it won''t later reset any changes I make).

    I am having trouble figuring out the procedure to make this happen.

    P.S. There is really no filter applied on the form, other than it being a data entry only form, so it does not load existing orders.


    I hear you, but other than the fact you have a dedicated form for adding orders I don''t see anything I haven''t already said. At the same time it doesn''t specifically confirm what I said as it uses different wording.

    I would say that the On Update event is probably not appropriate, as this will not display the change to the user before they submit the form.

    I''m still not sure whether or not this could be done by setting the default values when the form is initialised as you only say there is no filter applied. You don''t comment on whether or not the data can be guaranteed to be specifically for a particular customer.

    If this approach is appropriate, it certainly is the best for your needs.


    这篇关于使用另一个表自动填充表单中的复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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