473,407 Members | 2,326 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,407 software developers and data experts.

Foreign key field in table does not automatically populate from main table

I'm building an Access 2007 database by pasting field data from Excel 2007 into corresponding fields/tables in Access. The main Access table, AllDeathRecords, has an autonumbered primary key of PersonID. A second table, MultipleObituaries, has a PersonID field linked to the AllDeathRecords table. It's a one-to-many relationship; one person can have many obituaries.

My problem is that I've populated the AllDeathRecords table, so now it has many autonumbered PersonIDs, and because of the table relationship, I expected the MultipleObituaries table to show a long list of records, one for each PersonID, with otherwise blank fields in each. Then I could copy/paste from Excel to fill the other fields.

But the MultipleObituaries table is empty. How can I get it to fill in the PersonIDs from the main table? Or can I just append them manually?
Aug 10 '13 #1

✓ answered by jimatqsi

Sorry, wardwebber, it's not quite that automatic. Just you setting up that relationship does nothing to make records in one table magically appear in another. It does, however, prevent records from being in the MultipleObituaries table without a matching PersonID in the AllDeathRecords table. The AllDeathTable record must be entered before the other table can be populated for that person.

Do you know that you can link to your Excel sheet from Access. If you did that, and then wrote an append query, you could create your obituaries from the Excel sheet automatically.

Check out this search on the bytes site, study Access help about append queries, try a few things and then come back with more questions.
Search on Google for linking to excel from access site:bytes.com

Jim

2 3082
jimatqsi
1,271 Expert 1GB
Sorry, wardwebber, it's not quite that automatic. Just you setting up that relationship does nothing to make records in one table magically appear in another. It does, however, prevent records from being in the MultipleObituaries table without a matching PersonID in the AllDeathRecords table. The AllDeathTable record must be entered before the other table can be populated for that person.

Do you know that you can link to your Excel sheet from Access. If you did that, and then wrote an append query, you could create your obituaries from the Excel sheet automatically.

Check out this search on the bytes site, study Access help about append queries, try a few things and then come back with more questions.
Search on Google for linking to excel from access site:bytes.com

Jim
Aug 11 '13 #2
Thanks, Jim. Just wanted to ensure there wasn't an easier way. I ended up just pasting the PersonIDs manually into the MultipleObituaries table; I'll fill in the rest of the fields that way as well. I don't want to link to the Excel sheet, because it's not being maintained, but thanks for the tip anyway.
Aug 11 '13 #3

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

Similar topics

5
by: rbt | last post by:
How can I make a python client script connect to a Web server and automatically populate form fields and then submit the form? For example, say I wanted to check and see if 1924 was a leap...
2
by: Chand | last post by:
Hello Everyboy I am creating a small scale db with following fields in the table and form for the data entry purpose. Product ID Product Name Manufacturer Location 101 ...
3
by: dwightsmail | last post by:
hi all, can anyone help me? I am a relative newbie to sql server and I am more familiar with Enterprise Manager than QA. I have made many many access databases though. I am making an asp.net...
1
by: dmeyr | last post by:
Hello, I am new to Access and am having difficulty with a Dlookup function. I have a form that I wish to autopopulate 10 fields with values based on two criteria which are also fields on the form....
4
by: Bob | last post by:
Hi all, I've got a table that I've imported and it has junk at the top of the table, so after import I run a delete query to remove the junk lines then I'm left with the field names I want for...
2
by: Nate | last post by:
I am looking to populate a Schedule table with information from two other tables. I am able to populate it row by row, but I have created tables that should provide all necessary information for me...
340
by: MyWaterloo | last post by:
This thread has been closed as it has gotten just too big. If you have any questions about the application discussed in this thread please start a new thread in MS Access by clicking on the Start...
1
by: bbcdancer | last post by:
I have a database table called "tbl_personal" and struggling to VBA program a bit of code to create multiple tables in a database from the main "tbl_personal" table. In this case the 'color'...
1
by: emrodge | last post by:
Hi, I have a database where the 'ID' field in a table called 'Clients' has a one to many relationship with 3 other tables. One of these tables is called 'Contacts' which contains a field called...
7
by: munkee | last post by:
Hi all, I have 3 memo fields on my main table. I understand that they are susceptible to corruption over network environments. I am looking to move these memo fields in to seperate tables and I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.