Your data is really messed up, so , lets clean up tbl1,
make 2 queries using table1
append data from tbl1 into tbl2 using only ITEM, START
then append data in tbl1 into tbl2 using only ITEM, END
then run the code sent to parse out table2 into table3. (never overwrite the original)
change the tables in my code to match yours.
Code:
Public Function CollectTime()
Dim sSql As String
Dim vItm, vItm1, vStart, vStart1, vEnd
Dim rst 'As Recordset
sSql = "select * from TABLE2"
Set rst = CurrentDb.OpenRecordset(sSql)
With rst
vItm = .Fields("Item").Value & ""
vStart = .Fields("Start").Value & ""
vEnd = vStart - vStart1 - 1
If vItm = vItm1 Then
If vStart1 <> "" Then
'post emails to a table
sSql = "Insert into table3 ([Item],[Start],[End]) values ('" & vItm & "','" & vStart & "','" & vEnd & "')"
DoCmd.RunSQL sSql
End If
Else
vStart1 = ""
End If
vStart1 = vStart
vItm1 = vItm
.MoveNext
End With
rst.Close
Set rst = Nothing
End Function