Public Sub SplitTrans()
Dim db As dao.Database
Dim rsSource As dao.Recordset
Dim rsTarget As dao.Recordset
Dim i As Integer, iEnd As Integer
Set db = CurrentDb
Set rsSource = db.OpenRecordset("tableNametToSplit", dbOpenDynaset)
Set rsTarget = db.OpenRecordset("table2", dbOpenDynaset)
With rsSource
If Not (.BOF And .EOF) Then .MoveFirst
While Not .EOF
iEnd = !Qty
If iEnd > 1 Then
For i = 1 To iEnd
With rsTarget
.AddNew
![Location] = rsSource![Location]
![Part No] = rsSource![Part No]
![Price] = rsSource![Price]
![Qty] = 1
![Total] = rsSource![Total] / rsSource![Qty]
.Update
End With
Next i
End If
.MoveNext
Wend
End With
rsSource.Close
rsTarget.Close
Set rsSource = Nothing
Set rsTarget = Nothing
Set db = Nothing
End Sub