Hi
I changed the code as suggested
Private Sub cmdAddLines_Click()
10 On Error GoTo cmdAddLines_Click_Err
20 If Me.Dirty Then Me.Dirty = False
30 If DCount("[MainId]", "tblLineUnitEntries", "[MainId] = " & Me.txtMainID) <> 0 Then Me.Undo
40 If MsgBox("If These...