Those two links weren't the ones I usually reference for this issue. Here is the one I usually go to http://www.blueclaw-db.com/access_no...ed_example.htm. I am sure there are many more if you do a search. The trick with your situation is need to pass the new CompID created in the autonumber field back to the customer form. Most examples don't seem to deal with that.
Your code can be simple as:
Code:
Private Sub CompID_NotInList(NewData As String, Response As Integer)
Response = acDataErrContinue
Me.CompID = Null
DoCmd.OpenForm "company owner NAME details", acNormal, , , acFormAdd, acDialog, NewData
Me.CompID.Requery
End Sub
Code behind the company details form:
Code:
Private Sub Form_Current()
If Not IsNull(Me.OpenArgs) Then
Me![Company Or Owner] = Me.OpenArgs
DoCmd.RunCommand acCmdSaveRecord
Form_Customer.CompID.Requery
Form_Customer.CompID = Me.ID
End If
End Sub
Can have additional code for a MsgBox in the NotInList event to ask user if they really want to add new company record.