K
kerry
I have the following code that prints seasonal and nonseasonal wage records
for each employee. I can't seem to figure out how to add the code necessary
if an employee has seasonal AND nonseasonal wages for it to print out two
records for that one employee. Is there anyone out there that can help me
with this?
If rsDetailInfo!SeasonalWages > 0 Then
'print employee record
'print season wages
Print #1, "S" _
& rsDetailInfo!SocSecNum _
& Pad(rsDetailInfo!LastName, 20) _
& Pad(Left(rsDetailInfo!FirstName, 12), 12) _
& IIf(IsNull(rsDetailInfo!MiddleInitial), " ", rsDetailInfo!MiddleInitial) _
& "23" _
& Format(bteQuarter, "00") & strYear _
& Space(12) _
& CStr(Format(RemoveDecimals(rsDetailInfo!SeasonalWages), "00000000000000")) _
& "00000000000000" & "00000000000000" _
& Space(37) _
& "UTAX" _
& rsDetailInfo!StateID _
& Space(20) _
& "00000000000000" & "00000000000000" _
& "S" _
& Space(5) _
& "0" _
& IIf(rsDetailInfo!WorkedMonth1 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth2 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth3 = "Y", "1", "0") _
& strCurrentEmployer & rsDetailInfo!ITWSuffix _
& IIf(rsDetailInfo!Gender = "F", 1, 0) _
& "00000000" & "00000000" _
& Space(33)
lngEmpCount = lngEmpCount + 1
lngSTotal = lngSTotal + 1
ElseIf rsDetailInfo!NonseasonalWages > 0 Then
'Nonseasonal wages
Print #1, "S" _
& rsDetailInfo!SocSecNum _
& Pad(rsDetailInfo!LastName, 20) _
& Pad(Left(rsDetailInfo!FirstName, 12), 12) _
& IIf(IsNull(rsDetailInfo!MiddleInitial), " ", rsDetailInfo!MiddleInitial) _
& "23" _
& Format(bteQuarter, "00") & strYear _
& Space(12) _
& CStr(Format(RemoveDecimals(rsDetailInfo!NonseasonalWages),
"00000000000000")) _
& "00000000000000" & "00000000000000" _
& Space(37) _
& "UTAX" _
& rsDetailInfo!StateID _
& Space(20) _
& "00000000000000" & "00000000000000" _
& "N" _
& Space(5) _
& "0" _
& IIf(rsDetailInfo!WorkedMonth1 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth2 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth3 = "Y", "1", "0") _
& strCurrentEmployer & rsDetailInfo!ITWSuffix _
& IIf(rsDetailInfo!Gender = "F", 1, 0) _
& "00000000" & "00000000" _
& Space(33)
lngEmpCount = lngEmpCount + 1
lngSTotal = lngSTotal + 1
Else
'print employee record
' I tried adding the statement below but it still doesn't work!!!!!!!
If rsDetailInfo!SeasonalWages > 0 And rsDetailInfo!NonseasonalWages > 0 Then
Print #1, "S" _
& rsDetailInfo!SocSecNum _
& IIf(IsNull(rsDetailInfo!LastName), Pad(" ", 20),
Pad(rsDetailInfo!LastName, 20)) _
& IIf(IsNull(rsDetailInfo!FirstName), Pad(" ", 12),
Pad(Left(rsDetailInfo!FirstName, 12), 12)) _
& IIf(IsNull(rsDetailInfo!MiddleInitial), " ", rsDetailInfo!MiddleInitial) _
& "23" _
& Format(bteQuarter, "00") & strYear _
& Space(12) _
& CStr(Format(RemoveDecimals(IIf(rsDetailInfo!SeasonalWages > 0,
rsDetailInfo!SeasonalWages, rsDetailInfo!NonseasonalWages)),
"00000000000000")) _
& "00000000000000" & "00000000000000" _
& Space(37) _
& "UTAX" _
& rsDetailInfo!StateID _
& Space(20) _
& "00000000000000" & "00000000000000" _
& "S" _
& Space(5) _
& "0" _
& IIf(rsDetailInfo!WorkedMonth1 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth2 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth3 = "Y", "1", "0") _
& strCurrentEmployer & rsDetailInfo!ITWSuffix _
& IIf(rsDetailInfo!Gender = "F", 1, 0) _
& "00000000" & "00000000" _
& Space(33)
lngEmpCount = lngEmpCount + 1
lngSTotal = lngSTotal + 1
for each employee. I can't seem to figure out how to add the code necessary
if an employee has seasonal AND nonseasonal wages for it to print out two
records for that one employee. Is there anyone out there that can help me
with this?
If rsDetailInfo!SeasonalWages > 0 Then
'print employee record
'print season wages
Print #1, "S" _
& rsDetailInfo!SocSecNum _
& Pad(rsDetailInfo!LastName, 20) _
& Pad(Left(rsDetailInfo!FirstName, 12), 12) _
& IIf(IsNull(rsDetailInfo!MiddleInitial), " ", rsDetailInfo!MiddleInitial) _
& "23" _
& Format(bteQuarter, "00") & strYear _
& Space(12) _
& CStr(Format(RemoveDecimals(rsDetailInfo!SeasonalWages), "00000000000000")) _
& "00000000000000" & "00000000000000" _
& Space(37) _
& "UTAX" _
& rsDetailInfo!StateID _
& Space(20) _
& "00000000000000" & "00000000000000" _
& "S" _
& Space(5) _
& "0" _
& IIf(rsDetailInfo!WorkedMonth1 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth2 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth3 = "Y", "1", "0") _
& strCurrentEmployer & rsDetailInfo!ITWSuffix _
& IIf(rsDetailInfo!Gender = "F", 1, 0) _
& "00000000" & "00000000" _
& Space(33)
lngEmpCount = lngEmpCount + 1
lngSTotal = lngSTotal + 1
ElseIf rsDetailInfo!NonseasonalWages > 0 Then
'Nonseasonal wages
Print #1, "S" _
& rsDetailInfo!SocSecNum _
& Pad(rsDetailInfo!LastName, 20) _
& Pad(Left(rsDetailInfo!FirstName, 12), 12) _
& IIf(IsNull(rsDetailInfo!MiddleInitial), " ", rsDetailInfo!MiddleInitial) _
& "23" _
& Format(bteQuarter, "00") & strYear _
& Space(12) _
& CStr(Format(RemoveDecimals(rsDetailInfo!NonseasonalWages),
"00000000000000")) _
& "00000000000000" & "00000000000000" _
& Space(37) _
& "UTAX" _
& rsDetailInfo!StateID _
& Space(20) _
& "00000000000000" & "00000000000000" _
& "N" _
& Space(5) _
& "0" _
& IIf(rsDetailInfo!WorkedMonth1 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth2 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth3 = "Y", "1", "0") _
& strCurrentEmployer & rsDetailInfo!ITWSuffix _
& IIf(rsDetailInfo!Gender = "F", 1, 0) _
& "00000000" & "00000000" _
& Space(33)
lngEmpCount = lngEmpCount + 1
lngSTotal = lngSTotal + 1
Else
'print employee record
' I tried adding the statement below but it still doesn't work!!!!!!!
If rsDetailInfo!SeasonalWages > 0 And rsDetailInfo!NonseasonalWages > 0 Then
Print #1, "S" _
& rsDetailInfo!SocSecNum _
& IIf(IsNull(rsDetailInfo!LastName), Pad(" ", 20),
Pad(rsDetailInfo!LastName, 20)) _
& IIf(IsNull(rsDetailInfo!FirstName), Pad(" ", 12),
Pad(Left(rsDetailInfo!FirstName, 12), 12)) _
& IIf(IsNull(rsDetailInfo!MiddleInitial), " ", rsDetailInfo!MiddleInitial) _
& "23" _
& Format(bteQuarter, "00") & strYear _
& Space(12) _
& CStr(Format(RemoveDecimals(IIf(rsDetailInfo!SeasonalWages > 0,
rsDetailInfo!SeasonalWages, rsDetailInfo!NonseasonalWages)),
"00000000000000")) _
& "00000000000000" & "00000000000000" _
& Space(37) _
& "UTAX" _
& rsDetailInfo!StateID _
& Space(20) _
& "00000000000000" & "00000000000000" _
& "S" _
& Space(5) _
& "0" _
& IIf(rsDetailInfo!WorkedMonth1 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth2 = "Y", "1", "0") _
& IIf(rsDetailInfo!WorkedMonth3 = "Y", "1", "0") _
& strCurrentEmployer & rsDetailInfo!ITWSuffix _
& IIf(rsDetailInfo!Gender = "F", 1, 0) _
& "00000000" & "00000000" _
& Space(33)
lngEmpCount = lngEmpCount + 1
lngSTotal = lngSTotal + 1