Hello guys,
I have started using Base recently and so far I haven’t had any trouble, but I am facing a task which I am currently unable to solve.
I have two main tables: EVENTS and CAUSES (each table has two fields: ID and description).
Each EVENT can have multiple CAUSES and viceversa. This is why I have created a third table (RELATION_EVENTS_CAUSES), which contains two fields: ID_EVENTS and ID_CAUSES.
I have created a form, using some macros, which allows me to:
- Select an element from EVENTS table (Main Form 1, grid control with 1 text column)
- Add elements to CAUSE table (Main Form 2, grid control with 1 text column)
- Link causes to the selected event in RELATION_EVENTS_CAUSES (Sub Form 1, grid control with 1 listbox).
Using macros I was able to update the list box in Sub Form 1 whenever I add, remove or modify an element of CAUSE table but this is becoming impractical when the number of elements starts growing.
This is why I have thought to eliminate the Sub Form 1 grid control and replace it with a button (actually I would probably keep the grid control, but for display only)
Ideally, I would select one event on Main Form 1, one cause in Main Form 2 and use a button to add a record to RELATION_EVENTS_CAUSES, with the IDs of the selected elements.
I am not really looking for a ready-made solution, but I would like to know from people more experienced than me if this is feasible, if it’s gonna be hard or not, or if there are simpler solution to this task.
Thank you very much!