用于插入引用多个表数据的数据的数据表单 [英] Data form to insert data referencing multiple tables data

查看:63
本文介绍了用于插入引用多个表数据的数据的数据表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Good Evening,



我7年前在Access中开发了,现在在我的项目中我需要开发一些表格


有人可以告诉我或指导我做这个请求吗



1)基本上我们在SQL Server 2010中有2个表(我们计划将它们移动到ACcess),例如第一个表是  客户(CustID,CustType,Age) 第二个表是
CustomerContact (CustID,Email1,EMail2,City) 



我需要创建一个访问以将数据插入第二个表(但在表单上我需要在组合框中显示第一个表值)


所以在我的表单中我需要有Combobox(对于table1值为显示)CustID,Email1,Email2,城市文本框


第一个表3字段(Custid,Custtype,Age)的组合需要在组合框中每行填充一个值。用户从组合框中选择值,然后custid文本框将具有选定的值Custid,用户手动输入保留文本
框值(Email1,Email2,City),然后当他们点击插入按钮时,它应该将数据插入第二个表。 / p>


请指导我任何材料等...请


非常感谢您提前,


Asita

解决方案

您可以为组合框的RowSource创建查询。类似于:


选择CustID,CustType,来自客户的年龄


然后使用ColumnCount = 3和ControlSource = CustID设置此组合框( CustomerContact将值保存在其中)


顺便说一句,年龄是一个不好的维护领域:每天可能需要调整某人的年龄。 BirthDate好多了。


Hello Good Evening,

I Did development in Access 7 years back, now In my project I need to develop few forms

Can somebody please advise me or guide me to do this request

1) basically we have 2 tables in SQL server 2010(we are planning to move them to ACcess) for example first table is Customer (CustID, CustType, Age)  second table is CustomerContact (CustID, Email1, EMail2, City) 

I need to create a access for to insert data to Second table (but on form I need to show first table values in combobox)

so in my form I need to have Combobox (for table1 values to display) CustID, Email1, Email2, City text boxes

the combination of first table 3 fields (Custid, Custtype, Age) need to be populated as a single value per row in combobox when a user selects value from combobox then custid text box will have the selected value Custid and user manually enters remain text box values(Email1, Email2,City) then when they click on insert button it should insert data to second table.

please guide me on any materials etc... Please please

Thank you very much in Advance,

Asita

解决方案

You could create a query for the RowSource of the combobox. Something like:

select CustID, CustType, Age from Customer

Then setup this combobox with ColumnCount=3, and ControlSource=CustID (the field in CustomerContact that the value will be saved in)

Btw, Age is a bad field to maintain: every day someone's age may need to be adjusted. BirthDate is MUCH better.


这篇关于用于插入引用多个表数据的数据的数据表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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