Hello, everyone!
I have an Access 2002 DB. My question involves table relationships and cascading update.
Here's the set-up I have:
I have three tables in use, and their structure is described below:
tblDevicesVC
ID (PK, AutoNumber)
LocationID
RoomID
(lots of other fields)
tblLocation
ID (PK, AutoNumber)
Region
Office
Address1
Address2
City
St
Zip
Phone
tblRoom
ID (PK, AutoNumber)
LocationID
Floor/Room
Seats
ReservationContact
TechnicalContact
RoomPhone
SupportVendor
SuppExpiration
I have the relationships established as shown in the attached screenshot.
Here's the issue:
I have a query that pulls all the records necessary to populate forms for editing existing data (no problem) and inputting a new record (a similar form opened in DATA ENTRY mode). When a new record is created, a location is selected from a drop-down list populated with the values from the tblLocation table captured by the query. This works fine; all the relevant location data (address, phone number, etc.) is automatically populated on the form correctly.
Once the Location is chosen a record is added to the Devices table by updating the field LocationID (FK) in the Devices table with the ID of the Location table. This works correctly.
The data for the Room table comes next, but a new record in the Room table isn't created until the Floor/Room field is manually input on the form. That is to say, the LocationID field (FK) in the Room table is NOT updated by the Location table ID field, as it is for the Devices table.

The relationships between tables allow the Location table ID field to update to the Devices table field LocationID (FK). However, the Room table LocationID (FK) field, which has the EXACT SAME properties (long integer type, no decimal places, no default value in both tables, indexed with dupes OK), does NOT get updated when a new record is created.
I'm completely stumped. The relationships between the Room Table and Location table is EXACTLY the same as the relationship between the Location and Devices tables. The update works going from Location to Devices, but does NOT work going from Location to Room. I have no idea why.
I've tried juggling the relationshihps around in the relationships window, but all I manage to do there is stop my query from permitting addition of records. I also tried to manipulate the MASSIVE query I use to gather all the requisite information into one place, and I either end up with too many records or not enough. When it's the right amount, and I'm able to do additions, the updating as listed above does not function.
It's interesting to note that when I delete the test records from my query, the records ARE removed from the Devices table, and are NOT removed from the Room table. So, cascading delete doesn't work either.
If I've not provided enough information, please let me know. Any insights are greatly appreciated. I apologize for the long post, but I wanted to be sure there was enough information for all you to help. I probably still missed something, though.
Thanks in advance, everyone.
-JDT-
PS - If I don't have an image uploaded to the web, can I embed it into a post directly from my computer? (Sorry, just wondering.)
I have an Access 2002 DB. My question involves table relationships and cascading update.
Here's the set-up I have:
I have three tables in use, and their structure is described below:
tblDevicesVC
ID (PK, AutoNumber)
LocationID
RoomID
(lots of other fields)
tblLocation
ID (PK, AutoNumber)
Region
Office
Address1
Address2
City
St
Zip
Phone
tblRoom
ID (PK, AutoNumber)
LocationID
Floor/Room
Seats
ReservationContact
TechnicalContact
RoomPhone
SupportVendor
SuppExpiration
I have the relationships established as shown in the attached screenshot.
Here's the issue:
I have a query that pulls all the records necessary to populate forms for editing existing data (no problem) and inputting a new record (a similar form opened in DATA ENTRY mode). When a new record is created, a location is selected from a drop-down list populated with the values from the tblLocation table captured by the query. This works fine; all the relevant location data (address, phone number, etc.) is automatically populated on the form correctly.
Once the Location is chosen a record is added to the Devices table by updating the field LocationID (FK) in the Devices table with the ID of the Location table. This works correctly.
The data for the Room table comes next, but a new record in the Room table isn't created until the Floor/Room field is manually input on the form. That is to say, the LocationID field (FK) in the Room table is NOT updated by the Location table ID field, as it is for the Devices table.

The relationships between tables allow the Location table ID field to update to the Devices table field LocationID (FK). However, the Room table LocationID (FK) field, which has the EXACT SAME properties (long integer type, no decimal places, no default value in both tables, indexed with dupes OK), does NOT get updated when a new record is created.
I'm completely stumped. The relationships between the Room Table and Location table is EXACTLY the same as the relationship between the Location and Devices tables. The update works going from Location to Devices, but does NOT work going from Location to Room. I have no idea why.
I've tried juggling the relationshihps around in the relationships window, but all I manage to do there is stop my query from permitting addition of records. I also tried to manipulate the MASSIVE query I use to gather all the requisite information into one place, and I either end up with too many records or not enough. When it's the right amount, and I'm able to do additions, the updating as listed above does not function.
It's interesting to note that when I delete the test records from my query, the records ARE removed from the Devices table, and are NOT removed from the Room table. So, cascading delete doesn't work either.
If I've not provided enough information, please let me know. Any insights are greatly appreciated. I apologize for the long post, but I wanted to be sure there was enough information for all you to help. I probably still missed something, though.
Thanks in advance, everyone.
-JDT-
PS - If I don't have an image uploaded to the web, can I embed it into a post directly from my computer? (Sorry, just wondering.)