Hi!
another year, another problem
I have three tables related to this issue:
- Transactions
- LogBook
- Events
Now:
- Each Transaction can belong to just one Event
- Each LogBook can belong to just one Event
- Each Event can have many Transactions and many LogBook records assigned
- Transaction and/or LogBook can belong to Event alone (ie. LogBook belongs to Event without any Transaction involved, or vice versa)
- (now the problem): Transaction can be assigned to just one LogBook record, but LogBook record can have many transactions assigned
To demonstrate this issue in natural language:
During Friday Party (Event) where i used car to go there (CarLog entry) i paid parking fee 3 times (so LogBook has 3 Transactions assigned).
Rules:
- if Transaction and LogBook are connected, they must belong to the SAME Event
The issue is: how to build junction tables/relationships so that I can keep Event assignment for Transaction-LogBook pairs consistent?
Now I have design like that each Transaction and LogBook are associated with Event separatedly in its own table and when there is need to connect them I do some magic with VBA to ensure Events are the same, but it:
- duplicates the data (two same Event IDs FK) in two tables)
- still makes it error prone as what Event is right when not the same?
Please, do you have any ideas how to solve it?
another year, another problem

I have three tables related to this issue:
- Transactions
- LogBook
- Events
Now:
- Each Transaction can belong to just one Event
- Each LogBook can belong to just one Event
- Each Event can have many Transactions and many LogBook records assigned
- Transaction and/or LogBook can belong to Event alone (ie. LogBook belongs to Event without any Transaction involved, or vice versa)
- (now the problem): Transaction can be assigned to just one LogBook record, but LogBook record can have many transactions assigned
To demonstrate this issue in natural language:
During Friday Party (Event) where i used car to go there (CarLog entry) i paid parking fee 3 times (so LogBook has 3 Transactions assigned).
Rules:
- if Transaction and LogBook are connected, they must belong to the SAME Event
The issue is: how to build junction tables/relationships so that I can keep Event assignment for Transaction-LogBook pairs consistent?
Now I have design like that each Transaction and LogBook are associated with Event separatedly in its own table and when there is need to connect them I do some magic with VBA to ensure Events are the same, but it:
- duplicates the data (two same Event IDs FK) in two tables)
- still makes it error prone as what Event is right when not the same?
Please, do you have any ideas how to solve it?