473,382 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

add field from one table to another one

i have three tables,
"product"
"sales"
"artist"

they are set up to record information for a shop that sells arts and crafts on commission.

in the "product" table is a field named 'Product Name' which i need in the sales table along side each sale.

How do i do this??
Jan 16 '13 #1
3 6072
NeoPa
32,556 Expert Mod 16PB
What you do is link the two tables in a query and show the [Product Name] that way. The [Sales] table should have a field which is a Foreign Key (FK) that links into the [Product] table and should have the same value as that table's Primary Key (PK).

What you should never do is duplicate data in different places.

An article that explains why can be found at Database Normalisation and Table Structures.
Jan 16 '13 #2
Seth Schrock
2,965 Expert 2GB
There are a couple of ways to do this. With so little information however, it is tough to give exact information. You can do a DLookup() based on the Primary Key of the Products table to put the information in the Sales table or you can use a query that pulls the Foreign Key from the Sales table and the product description, price, etc. from the Products table. Both can be the right way for certain circumstances, but not in all.

I have actually just recently created a database similar to what I think you need, but again, there isn't a lot of information to go on. A few things that would be helpful would be the Primary key fields and their data types from the products table and the sales table. Any relationships between the tables and what you are using as the foreign key. Also, how you are planning on selecting the product to sell (ie. typing in a product number, selecting a name from combo box, etc.)?

**Edit**
Be sure to read the link that NeoPa posted. It will be extremely helpful as you design your database and save you many headaches.
Jan 16 '13 #3
zmbd
5,501 Expert Mod 4TB
@OP: Actually you need to read at least one more link: A Tutorial for Access
Jan 16 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Tony Johnson | last post by:
I want to update a particular field in a form for only a certain set of records. The certain set of records is named Financed. I need to update those Financed records with a financed number that...
2
by: Rooksarii | last post by:
Hello folks, Let me first apologize for any impropper terminology I may use as I am presently trying to broaden my Office knowledge by diving into Access head on. My specific problem is this....
6
by: Carlos | last post by:
Hi all, I am trying to access a public field of another form class within the same namespace. The field is public, what is the best way to access it from a different class? I defined as private...
3
by: C8H10N4O2 | last post by:
How would I set one fields value equal to something based on another table in a form. For instance, could I implement VB on enter in a form's combo box to set a number field equal to one or zero in...
0
by: kalyanakrishna | last post by:
I am not able to create a trigger on Text field table Comments will be appriciatable.
6
by: KevinPreston | last post by:
Hello everyone, this is my first post so apologies if i dont get it right first time, i am a self taught Access user, i am stuck on something i am trying to do, briefly i have 2 tables, one for...
3
by: webcat | last post by:
this is crazy, why can't i get this to work?!! i have a complex DB with many tables, but the ones that count here are: a linked SQL table with many records and a field called userEmail ...
2
by: Hillwalker | last post by:
Hi Raw recruit, no VB knowledge but some general programming experience..... Access 2000 on XP In form view, I wish to fill the field (ONLY on the record being viewed) with the maximum value...
4
by: sirvi | last post by:
what validation rule can be used to show :we cannot enter a data in a field, when another field does not have data.for example we can not enter details of a person untill we dont enter his name.
23
by: SusanK4305 | last post by:
I have a DB table that is linked to my new DB. I can't edited the linked table. So I created another DB w/ additional data however I still need to pull data over from one to the other. My DB has 2...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.