0

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: enter image description here

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?

David
  • 97
  • 5
  • You should normalize your database. See "Normalize" in http://stackoverflow.com/questions/621884/database-development-mistakes-made-by-application-developers/621891#621891 – Astra Bear Mar 16 '15 at 02:42
  • @AstraBear Hmmm... I read through that link. I could get this down to two tables Account and Order respectively. I think the main thing I am failing to understand is how do I link the User Account with their Order? I havent done much testing because I am still learning and building at the same time. – David Mar 16 '15 at 03:06

1 Answers1

1

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

Astra Bear
  • 2,646
  • 1
  • 20
  • 27