Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop, Case Else Help

Status
Not open for further replies.

shawn876

Programmer
Feb 19, 2004
17
US
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 &nbsp; 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 = "&nbsp;"
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 = "&nbsp;"
Else
Exit Function
End if
end if
End Select
next
if len(tval) = 0 then
tval = "&nbsp;"
end if
OTHPayCode = tval
End Function
Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top