The answer to this question may not involve VBA but I'm hoping someone can steer me in the right direction. For simplicity in explaining the issue, I am going to use a simplified example.
I have a table of Projects "tblProjects". With "ProjectID" as the primary key and fields "Base_Due_Date" and "Total_Days_Extended" . During the course of the project execution, the Project Manager may request one or more (probably not more than three but just out of interest, lets say unlimited). When an extension is granted, the due date is revised (pushed forward by the approved number of days).
So in a query I can have Due_Date = DateAdd("d, "Base_Due_Date", "Total_Days_Extended")
My table might look like this
ProjID Base_Due_Date Total_Days_Extended
1 1/1/2024 ??
2 2/1/2024 ??
3 3/1/2024 ??
My problem (question) is how to go about resolving "Total_Days_Extended).
I am just one step above being a complete novice but I believe the approach would be to have another table of extensions tblExtensions that has a relationship with tblProjects. Each approved extension is entered into that table. So it might look like this:
ExtID, ProjectID NumDay
1 1 10
2 2 15
3 1 30
... and with the proper relationship have a result in my tblProjects like this:
ProjID Base_Due_Date Total_Days_Extended
1 1/1/2024 40
2 2/1/2024 15
3 3/1/2024 0
Then if an extension of ProjID is approved:
ExtID, ProjectID NumDay
1 1 10
2 2 15
3 1 30
4 3 20
I get:
ProjID Base_Due_Date Total_Days_Extended
1 1/1/2024 40
2 2/1/2024 15
3 3/1/2024 20
If this is even possible, how would one go about setting up the relationship and between the tables and how would one define the "Total_Days_Extended" field expression to sum or add up all the extensions related to that record.
Thank you!!