When you enter the main form record, and move into the subform to enter the
line items, the header record saves into its table. Consequently you can't
just "undo" the record and whatever line items you have entered in the
subform.
Perhaps you could add a Delete button to the main form, and use cascading
deletes to delete the line items in the subform as well:
1. Open the Relationships window (Tools menu, or Database tab of the ribbon
in A2007). Create a relationship between tblInvoice.InvoiceID (the primary
key) and tblInvoiceDetail.InvoiceID (the foreigh key), and check the boxes
for:
[ ] Referential Integrity
[ ] Cascading Deletes
2. Open your main form in design view, and add a command button with these
properties:
Name cmdDelete
Caption Delete this invoice
On Click [Event procedure]
3. Click the Build button (...) beside the On Click property.
Access opens the code window.
Set up the code so it looks like this:
Private Sub cmdDelete_Click()
If Me.Dirty Then
Me.Undo
End If
If Not Me.NewRecord Then
RunCommand acCmdDeleteRecord
End If
End Sub
Clicking the button will now delete the invoice, and the cascading delete
will delete any line items in that invoice.

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> I have a form/subform for entering invoice data. What can I do if I
> realize that I have already entered the invoice ? Example: I enter
[quoted text clipped - 7 lines]
> Thanks in advance
> Mark Thornblad