Can anyone help me with this. Everything seems to work ok until it needs to populate the new table with the last record set. Any ideas would be most appreciated.
Function Main()
If DTSSource("ConNo")&DTSSource("")&DTSSource("Month") = DTSDestination("CNo")&DTSDestination("Year")&DTSDestination("Month") Or _ 'When Values are the same
'First Record Test
IsNull(DTSDestination("CNo")&DTSDestination("Year")&DTSDestination("Month")) then
'Assign Values to ContractNo, Year and Month
DTSDestination("CNo") =DTSSource("ConNo")
DTSDestination("Year")=DTSSource("Year")
DTSDestination("Month")=DTSSource("Month")
'Load data from the current data source record to destination column
Select Case DTSSource("Type")
Case "I "
DTSDestination("Income") = DTSSource("Value")
Case "C "
DTSDestination("Cost") = DTSSource("Value")
End Select
'Assign transformation status to skip insert
Main = DTSTransformStat_SkipInsert
Else
Main = DTSTransformStat_SkipFetch
End If
End Function
Function PostSourceMain()
On Error Resume Next
DTSLookups("InsertLR").Execute _
DTSDestination("CNo"),_
DTSDestination("Year"),_
DTSDestination("Month"),_
DTSDestination("Cost"),_
DTSDestination("Income")
If Err.Number <> 0 Then
Msgbox cstr(Err.Number) & " " & Err.Description
PostSourceMain = DTSTransformstat_Error
Else
PostSourceMain = DTSTransformstat_OK
End If
End Function
Cheers
Function Main()
If DTSSource("ConNo")&DTSSource("")&DTSSource("Month") = DTSDestination("CNo")&DTSDestination("Year")&DTSDestination("Month") Or _ 'When Values are the same
'First Record Test
IsNull(DTSDestination("CNo")&DTSDestination("Year")&DTSDestination("Month")) then
'Assign Values to ContractNo, Year and Month
DTSDestination("CNo") =DTSSource("ConNo")
DTSDestination("Year")=DTSSource("Year")
DTSDestination("Month")=DTSSource("Month")
'Load data from the current data source record to destination column
Select Case DTSSource("Type")
Case "I "
DTSDestination("Income") = DTSSource("Value")
Case "C "
DTSDestination("Cost") = DTSSource("Value")
End Select
'Assign transformation status to skip insert
Main = DTSTransformStat_SkipInsert
Else
Main = DTSTransformStat_SkipFetch
End If
End Function
Function PostSourceMain()
On Error Resume Next
DTSLookups("InsertLR").Execute _
DTSDestination("CNo"),_
DTSDestination("Year"),_
DTSDestination("Month"),_
DTSDestination("Cost"),_
DTSDestination("Income")
If Err.Number <> 0 Then
Msgbox cstr(Err.Number) & " " & Err.Description
PostSourceMain = DTSTransformstat_Error
Else
PostSourceMain = DTSTransformstat_OK
End If
End Function
Cheers