Is it possible to have access create primary keys for items by appending a string to the primary key one level above it?
I am trying to create an inventory management database for my company's server ops team, to keep track of things such as switches, servers, UPS's, etc. I have things organized to separate our different locations, the different rooms in said locations, the different racks in said rooms, and finally a 1-1 relationship between an occupied rack U and a device. The primary key for locations would be a simple, 3-letter designation that we use as a site code. The primary key for a room would be that site code plus "
-###" where "###" is the displayed room number. This is to simplify the attributes for the room/lower levels (i originally had an auto-gen number for pKey, with a separate attribute for display number). this would continue down, until the rackU and/or device entities. For them, i'm looking to allow the admins to use a form, select the correct Location, Room, and Rack#, then enter a rackU and serial number/asset tag for the device. Then the rackU primary key would need to generate itself to be the primary key value of its associated rack, plus the U number.
To simplify, I would be manually inputting each entry down to rackU, and primary keys would look like:
[Room]-A/1 (some racks are lettered, some are numbered)
Then, when entering a new device, user would select Location, Room, Rack, and input a rackU number. I need some way to auto-generate the rackU primary key to be the linked Rack primary key plus the given U number.
It's one of those things where I'm fairly certain I could make it work if I was writing this database from scratch in python or PHP, or if i was using an actual mySQL database, but I'm completely lost as to how to handle this in Access.