Hi I have the following Code(bottom).
The thing with this code is if the Paycode is used already for that person then it fills up the the <TH> tags assoicated with it. I need it to basically if I used a code called BHP and it fills it in already. So when it gets to the next TH tag it will just go to the next paycode to fill in and not duplicate the same paycode. If it doesn't have anymore paycode and it has one then place a or exit function.
Public Function OTHPayCode(byval lngPage, byval lngRow, byval lngWeek, byval strPayCode)
dim i
dim tval
dim tmpPayrollCode
on error resume next
tval = " "
i = lngPage * 2 + lngRow - 2
for j = 1 to 12
tmpPayrollCode = arrAll(i,3)(lngWeek,j,2)
Select Case tmpPayrollCode
'Case "REG", "OT", "SHP","UHP","SUPP","BHP","SDP","LAN","ABN","TDN","SHN","UHN","SDN","MLN"
Case "REG", "OT", "SHP","UHP","LAN","ABN","TDN","SHN","UHN","SDN","MLN"
'do nothing
Case strPayCode
'do nothing
Case Else
if arrAll(i,3)(lngWeek,j,4) > 0 then
tval = arrAll(i,3)(lngWeek,j,2)
OTHPayCode = tval
strPayCode = strPayCode & ", " & OTHPayCode
if len(OTHPayCode)=0 then
OTHPayCode = " "
Else
Exit Function
End if
end if
End Select
next
if len(tval) = 0 then
tval = " "
end if
OTHPayCode = tval
End Function
Thanks
The thing with this code is if the Paycode is used already for that person then it fills up the the <TH> tags assoicated with it. I need it to basically if I used a code called BHP and it fills it in already. So when it gets to the next TH tag it will just go to the next paycode to fill in and not duplicate the same paycode. If it doesn't have anymore paycode and it has one then place a or exit function.
Public Function OTHPayCode(byval lngPage, byval lngRow, byval lngWeek, byval strPayCode)
dim i
dim tval
dim tmpPayrollCode
on error resume next
tval = " "
i = lngPage * 2 + lngRow - 2
for j = 1 to 12
tmpPayrollCode = arrAll(i,3)(lngWeek,j,2)
Select Case tmpPayrollCode
'Case "REG", "OT", "SHP","UHP","SUPP","BHP","SDP","LAN","ABN","TDN","SHN","UHN","SDN","MLN"
Case "REG", "OT", "SHP","UHP","LAN","ABN","TDN","SHN","UHN","SDN","MLN"
'do nothing
Case strPayCode
'do nothing
Case Else
if arrAll(i,3)(lngWeek,j,4) > 0 then
tval = arrAll(i,3)(lngWeek,j,2)
OTHPayCode = tval
strPayCode = strPayCode & ", " & OTHPayCode
if len(OTHPayCode)=0 then
OTHPayCode = " "
Else
Exit Function
End if
end if
End Select
next
if len(tval) = 0 then
tval = " "
end if
OTHPayCode = tval
End Function
Thanks