如何通过在组合框中选择一个值来更改字段的控制源? [英] How to change the control source of fields by selecting a value in combo box?

查看:72
本文介绍了如何通过在组合框中选择一个值来更改字段的控制源?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有一个Form,其记录源设置为Table1,Form中的所有字段''控件源都设置为Table1中的字段。并点击添加按钮按钮,表单中输入的数据将保存为Table1中的记录。现在我正在搜索的是,当我单击表单中组合框中的值时,所有字段的输入数据应该在单击添加时保存在表2中。按钮。

我是编码的新手。我感谢任何帮助。

解决方案

所以你想要保存在table1中的表2中输入的数据相同吗?这看起来像是一个非常糟糕的设计,因为你几乎应该(只有0.0000001%的时间)从未在关系数据库(例如Access)中拥有重复数据。你想做什么?我们或许可以帮助您找到更好的解决方案。


不,当我们在组合框中单击一个唯一值时,我们不希望将数据保存在Table1中。数据应仅保存在表2中。


换句话说,如果在组合框中选择适当的值,您希望表单的记录源更改为table2吗?

Hi,

I have a Form with record source set to a Table1 and all the fields'' control source in the Form are set to the fields in the Table1. And by clicking "add" button, the entered data in the Form gets saved as a record in Table1. Now what I''m searching for is, when I click a value in a combo box in the Form, all the fields'' entered data should get saved in Table2 on clicking the "add" button.
I''m a novice in coding. I appreciate any help.

解决方案

So you want the same data entered in table2 as you are saving in table1? This seems like a very poor design, as you should almost (like only 0.0000001% of the time) never had duplicated data in a relational database (such as Access). What are you trying to do? We may be able to help you come up with a better solution.


No, We don''t want the data to be saved in Table1 when we click a unique value in combo box. The data should only get saved in Table2.


So in other words, you want the record source of the form to change to table2 if you select the appropriate value in the combo box?


这篇关于如何通过在组合框中选择一个值来更改字段的控制源?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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