I have been tasked to create an in-house resource allocation plan for my team. As we have multiple masters requesting the same resources.
The Recording of tasks, who they came from and their current status I have managed to sort out. However, next task is to plan allocation for the next year. I have decided to allocate on a weekly basis and so created 52 fields for each year.
In order to produce an easy to reference report I have created a report with 52 unbound text boxes in the detail section. I intend to change the color of if the box if their is planned activity for that task in that week. I have written the following code to change the textbox color:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.W01 = "AR" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'AR'")
If Me.W01 = "CI" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'CI'")
If Me.W01 = "CR" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'CR'")
If Me.W01 = "DS" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'DS'")
If Me.W01 = "QA" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QA'")
If Me.W01 = "QC" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QC'")
If Me.W01 = "QD" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QD'")
If Me.W02 = "AR" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'AR'")
If Me.W02 = "CI" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'CI'")
If Me.W02 = "CR" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'CR'")
If Me.W02 = "DS" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'DS'")
If Me.W02 = "QA" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QA'")
If Me.W02 = "QC" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QC'")
If Me.W02 = "QD" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QD'")
End Sub
Is this the most effect way of acheiving my goal, or have I missed a trick. (I have obviously only included the first two boxes to be formatted)
Thankyou in advance.
Tiggaa
The Recording of tasks, who they came from and their current status I have managed to sort out. However, next task is to plan allocation for the next year. I have decided to allocate on a weekly basis and so created 52 fields for each year.
In order to produce an easy to reference report I have created a report with 52 unbound text boxes in the detail section. I intend to change the color of if the box if their is planned activity for that task in that week. I have written the following code to change the textbox color:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.W01 = "AR" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'AR'")
If Me.W01 = "CI" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'CI'")
If Me.W01 = "CR" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'CR'")
If Me.W01 = "DS" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'DS'")
If Me.W01 = "QA" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QA'")
If Me.W01 = "QC" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QC'")
If Me.W01 = "QD" Then Me.T01.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QD'")
If Me.W02 = "AR" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'AR'")
If Me.W02 = "CI" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'CI'")
If Me.W02 = "CR" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'CR'")
If Me.W02 = "DS" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'DS'")
If Me.W02 = "QA" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QA'")
If Me.W02 = "QC" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QC'")
If Me.W02 = "QD" Then Me.T02.BackColor = DLookup("BackColor", "tblCalCode", "Code = 'QD'")
End Sub
Is this the most effect way of acheiving my goal, or have I missed a trick. (I have obviously only included the first two boxes to be formatted)
Thankyou in advance.
Tiggaa