That is where the Delete command we commented out comes in to play. So we want to uncomment it.
I was playing around with it, and this order seems to have the nicest results:
Code:
Private Sub Command18_Click()
' Add new record
Me.Refresh
DoCmd.SetWarnings False
DoCmd.OpenQuery "TempCustQuery", acViewNormal, acEdit
MsgBox (Me.TempCustName & " has been entered as a new company.")
' Then delete it from the temp table and form
DoCmd.RunSQL "Delete [tblTemporaryCustomer].* From [tblTemporaryCustomer];"
Me.Requery
DoCmd.SetWarnings True
End Sub
Without the "Requery" line, all the fields would show as "#DELETED" on the Form.