I have an array of (30,3).
I do not want to do too many if then statements. Basically they are 30 time codes and 2 weeks of hours for the timecode.
So currently I am doing the following:
Week(x,0)=rsWeek("TimeCodeID"
Week(x,1)=rsWeek("dblHoursW1"
Week(x,2)=rsWeek("dblHoursW2"
if Week(x,0)= 1 then
strDataScript = strDataScript & "Document.All(""REGLabel1_" & iPageCount & "_" & iRowCount & "_20"".innerhtml = """ & Week(x,1) & """" & vbcrlf
strDataScript = strDataScript & "Document.All(""REGLabel2_" & iPageCount & "_" & iRowCount & "_21"".innerhtml = """ & Week(x,2) & """" & vbcrlf
End if
if Week(x,0)=2 then
strDataScript = strDataScript & "Document.All(""OTLabel1_" & iPageCount & "_" & iRowCount & "_22"".innerhtml = """ & Week(x,1) & """" & vbcrlf
strDataScript = strDataScript & "Document.All(""OTLabel2_" & iPageCount & "_" & iRowCount & "_23"".innerhtml = """ & Week(x,2) & """" & vbcrlf
End if
if Week(x,0)=4 then
strDataScript = strDataScript & "Document.All(""BHPLabel1_" & iPageCount & "_" & iRowCount & "_24"".innerhtml = """ & Week(x,1) & """" & vbcrlf
strDataScript = strDataScript & "Document.All(""BHPLabel2_" & iPageCount & "_" & iRowCount & "_25"".innerhtml = """ & Week(x,2) & """" & vbcrlf
End if
is there a better way to do this instead of writing 30 if then statements.
Thanks
I do not want to do too many if then statements. Basically they are 30 time codes and 2 weeks of hours for the timecode.
So currently I am doing the following:
Week(x,0)=rsWeek("TimeCodeID"
Week(x,1)=rsWeek("dblHoursW1"
Week(x,2)=rsWeek("dblHoursW2"
if Week(x,0)= 1 then
strDataScript = strDataScript & "Document.All(""REGLabel1_" & iPageCount & "_" & iRowCount & "_20"".innerhtml = """ & Week(x,1) & """" & vbcrlf
strDataScript = strDataScript & "Document.All(""REGLabel2_" & iPageCount & "_" & iRowCount & "_21"".innerhtml = """ & Week(x,2) & """" & vbcrlf
End if
if Week(x,0)=2 then
strDataScript = strDataScript & "Document.All(""OTLabel1_" & iPageCount & "_" & iRowCount & "_22"".innerhtml = """ & Week(x,1) & """" & vbcrlf
strDataScript = strDataScript & "Document.All(""OTLabel2_" & iPageCount & "_" & iRowCount & "_23"".innerhtml = """ & Week(x,2) & """" & vbcrlf
End if
if Week(x,0)=4 then
strDataScript = strDataScript & "Document.All(""BHPLabel1_" & iPageCount & "_" & iRowCount & "_24"".innerhtml = """ & Week(x,1) & """" & vbcrlf
strDataScript = strDataScript & "Document.All(""BHPLabel2_" & iPageCount & "_" & iRowCount & "_25"".innerhtml = """ & Week(x,2) & """" & vbcrlf
End if
is there a better way to do this instead of writing 30 if then statements.
Thanks