Function Code_Fragment_7_11()

Dim dbs As Database
Dim Part_A, Part_B, Part_C As String

Set dbs = CurrentDb()


Part_A = "INSERT INTO INCUMBENTS ( SSN, PCN, START_DATE, END_DATE ) " _
       & "SELECT " & Chr(34) & "111223333" & Chr(34) & ", " & Chr(34) & "341288" & Chr(34) & ", " _
       & "DATE(), END_DATE " _
       & "FROM INCUMBENTS " _
       & "WHERE SSN = " & Chr(34) & "111223333" & Chr(34) & " " _
       & "AND START_DATE<=DATE() " _
       & "AND END_DATE>DATE();"

Part_B = "UPDATE INCUMBENTS SET END_DATE = DATE() " _
       & "WHERE SSN = " & Chr(34) & "111223333" & Chr(34) & " " _
       & "AND PCN <> " & Chr(34) & "341288" & Chr(34) & " " _
       & "AND START_DATE < DATE() " _
       & "AND END_DATE > DATE();"

Part_C = "UPDATE INCUMBENTS " _
       & "SET PCN = " & Chr(34) & "341288" & Chr(34) & " " _
       & "WHERE SSN = " & Chr(34) & "111223333" & Chr(34) & " " _
       & "AND START_DATE > DATE();"

dbs.Execute (Part_A)
dbs.Execute (Part_B)
dbs.Execute (Part_C)

End Function
