I am looking for some basic help in understanding and setting up table relationships in Access.
I've created one table called PROJECTS and it has the field JobNo which I've declared as the key field. It also contains such fields as Rep, Date, Descrip and so on.
I also have another table called DETAILS and it contains the following fields: ID (key field), JobNo, Rep, Date, Contact, PhNum, FileLoc and so on.
I have created a relationship between PROJECTS and DETAILS using the JobNo field from PROJECTS (the "1" side) to the JobNo field of DETAILS (the "infinity" or many side). Since JobNo from the PROJECTS table is a key field, I am able to turn on "Enforce Referential Integrity" and I select both "Cascade..." options.
My goal is to have the relationship link matching JobNo fields from both tables together, and to have fields with the DETAILS table automatically update if a matching field exists within the PROJECTS table. For example, after creating the relationship I expected to change Rep from the PROJECTS table and have it propagate over to the Rep field in the DETAILS table -- dint happen. Like fields from both tables are declared with the same formatting features, by the way (both Text or Number, same length, no conditions, etc.). Also, I made sure the key field's Indexed property from the parent table was set to YES (No Duplicates).
Despite the relationship between the two tables, matching fields within both tables behaves as if they are completely unique; I can update the Rep field in DETAILS and nothing happens in the Rep field of PROJECTS, and vice versa.
This description is much longer than I anticipated, but if anyone has some pointers on establishing relationships I am 100% ears.
Thanks in advance.
3 2065
I made an update query which finds like fields from the primary table and updates secondary tables. The user will invoke the query when the form is opened or closed so that current data is always synchronised.
No idea if that's "the correct way" but it works for me. Again, not pleased with my hacking; want to understand but me not smart. Back to mashing the keyboard...
MMcCarthy 14,534
Recognized Expert Moderator MVP
While connecting some tables in ACC2003 I ran into an interesting problem, not sure if it's me or what. Here's the scenario:
I open the Relationships... window and graphically connect two tables, ProjName and ProjActivities. Within each table is the field "PName" which I join (type Indeterminant, category 1: include rows from both tables where both fields are equal). This field is not the key field in either table and is of the same type in both tables.
When I then double click on the parent table (ProjName) in Datasheet view I don't see the cute little plus signs next to each record like I would expect, and I begin weeping.
After an hour or so I re-open the Relationships table and edit my relationship to join the key field, ID, from the parent table to ID in the child table. This doesn't make sense to me but then again what does in this crazy world. I re-open the parent table and voila - there are my plus signs. No useful data is shown (when I expand a plus sign to reveal the underlying table records) but at least I am reunited with my plus signs.
I then re-re-open the Relationships table, edit the relationship to delete the ID join but leave the PName join intact and re-re-open the parent table: Plus signs are a go and now it shows the linked data between both tables (when I click on a plus sign).
Prior to doing the "key field shuffle" I tried the "Repair and Compact Database" utility with no luck. This d/b is small and I'm just starting on it so it's not like Access has to wrestle with large amounts of data. I'm guessing if I could take a gander at the SQL for the table join something would be different before and after I perform the key field waltz.
Love me some comments!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: toedipper |
last post by:
Hello,
I am designing a table of vehicle types, nothing special, just a list of
unique vehicle types such as truck, lorry, bike, motor bike, plane, tractor
etc etc
For the table design I am...
|
by: robert |
last post by:
i need to update a column which is a member of the PK on this
table. there are some thousands of rows to be updated, many more
thousand already in the table.
so, i get a constraint violation...
|
by: Dan |
last post by:
Hi, just ran into my first instance of a backend Access97 database not
compacting. I'm getting the "MSACCESS.EXE has generated errors.." message on
compact.
I've narrowed it down to the largest...
|
by: Lee C. |
last post by:
I'm finding this to be extremely difficult to set up. I understand
that Access won't manage the primary key and the cascade updates for a
table. Fine. I tried changing the PK type to number and...
|
by: Bri |
last post by:
Hi,
First let me explain the process I have going on, then I'll address the
problems I'm having:
1) Insert records in a temp table using a query
2) Using a query that joins the temp table with...
| |
by: Shibu |
last post by:
Hi,
I have a situation where I need to convert business objects to a flat table.
The reverse is also required. I am using c# and
Oracle ODP. I am looking for an easier method to do the below...
|
by: bobh |
last post by:
Hi All,
In AccessXP I create an Access table then create an update query which
updates a field in that table with data from an SQLServer table and
when I run it I get the message
'operation...
|
by: ravichoudhari |
last post by:
i came accross requirement of multiple foreign keys in a table
referencing the same primary key another table. i created the table
relations using the relations editor in access. even though i...
|
by: melchior |
last post by:
Hi,
I have searched and searched without much luck. I feel like I am doing the right thing, just not getting the right result, so here goes.
I have 2 tables. One has about 100,000 records...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
| |
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...
|
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: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |