Hi,
I want to make an access database but Im struggling with the relations a bit.
I understand the one-to-many and many-to-many concept but seems like there is more then that
I want to make a database that keeps track of things we lend.
I have several items with different properties we lend out:
eg
TANK
-ID
-Volume
-Weight
MACHINE
-ID
-hours
-fueltype
...
I made the following tables to keep track of it:
RENT
-ID
-Customer
-...
One-to- many relationship between these
RENTLINE
-ID
-RENT_ID
-Item
My problem lies with this Item.
I want this Item to have a relation with the ID of the different items we lend out. there needs to be a one-to-many relation here.
one rentline can exist of one TANK OR of one MACHINE.
A TANK or a MACHINE can exist on many orderlines.
So I made 2 one to many relationships from Rentline to the id's of Tank and Machine
the problem is that Access does not let me fill in the rentline with the id of a item. If I fill in the ID of a TANK it says a ID of a machine is needed and vice-versa.
I tried to solve it with an intermediate ITEM table that looks like this :
ITEM
-ID
-Sort ( Tank or Machine)
-ItemID (Id of the tank OR the Machine)
But this generates the same issue as directly in the rentline...
I guess this is pretty common stuff Im asking here but its confusing me like hell
thanks in advance for all advice
I want to make an access database but Im struggling with the relations a bit.
I understand the one-to-many and many-to-many concept but seems like there is more then that
I want to make a database that keeps track of things we lend.
I have several items with different properties we lend out:
eg
TANK
-ID
-Volume
-Weight
MACHINE
-ID
-hours
-fueltype
...
I made the following tables to keep track of it:
RENT
-ID
-Customer
-...
One-to- many relationship between these
RENTLINE
-ID
-RENT_ID
-Item
My problem lies with this Item.
I want this Item to have a relation with the ID of the different items we lend out. there needs to be a one-to-many relation here.
one rentline can exist of one TANK OR of one MACHINE.
A TANK or a MACHINE can exist on many orderlines.
So I made 2 one to many relationships from Rentline to the id's of Tank and Machine
the problem is that Access does not let me fill in the rentline with the id of a item. If I fill in the ID of a TANK it says a ID of a machine is needed and vice-versa.
I tried to solve it with an intermediate ITEM table that looks like this :
ITEM
-ID
-Sort ( Tank or Machine)
-ItemID (Id of the tank OR the Machine)
But this generates the same issue as directly in the rentline...
I guess this is pretty common stuff Im asking here but its confusing me like hell
thanks in advance for all advice