如何将帐户表与MS Access 2013中的订单表相链接? [英] How do I link an Account table with an Order table in MS Access 2013?

查看:117
本文介绍了如何将帐户表与MS Access 2013中的订单表相链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在建立我的表格之间的关系。我不知道如果我这样做是最有效的方式或不。似乎在我的头上工作。



我有一个简单的帐户设置,只包括电子邮件和时间戳的订单号码。



我想要的访问是自动插入这个信息在不同的表,所以用户不必在每个表单上重新输入。



这里是我现在的关系表:



这样,电子邮件帐户和订单号在表之间匹配,以保持信息链接。我已经在保存 openForm 的表单上添加了一个按钮,但我找不到一个选项,插入数据。






EDIT



尝试规范化表。仍然不知道如何我可以链接到一起。

解决方案

这是一个开始:



使用以下字段创建帐户表:id,name,email(say)



有订单表,包含id,accountId,orderAmount



将Order.accountId作为与Account.id关联的外键



p>

选择帐户。,订单。从帐户内部连接Order. Account.id = Order.accountId


I'm working on building relationships between my tables. I am not sure if I am doing this the most efficient way or not. Seems to work in my head.

What I have is a simple account set-up that consists of just an email and a time-stamped order number.

What I would like Access to do is automatically insert this information across different tables so the user doesn't have to retype them over on every form.

Here is the relationship table I have now:

This way the email account and order number match across the tables for keeping the information linked. I have added a button on the forms that save and openForm but I can't find an option that will auto-insert data.


EDIT

I have taken advice and trying to Normalize the tables. Still not sure how I can link them together. How can I group that entire order with that one customer?

解决方案

Here is a start:

Make Account table with fields: id, name, email (say)

Have Order table with fields: id, accountId, orderAmount (say)

Make Order.accountId a foreign key linked to Account.id

When you query do something like

select Account., Order. from Account inner join Order on Account.id = Order.accountId

这篇关于如何将帐户表与MS Access 2013中的订单表相链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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