OK,
So I changed it to this:
Code:
Private Sub CboContactID_NotInList(NewData As String, Response As Integer)
Dim strsql As String, x As Integer
Dim LinkCriteria As String
x = MsgBox("Contact not in Current List, Would you Like to Add?", vbYesNo)
If x = vbYes Then
strsql = "INSERT INTO ContactTbl (CompanyID, ContactFirst) " & _
"VALUES (" & CboCompanyID & ", '" & NewData & "')"
'MsgBox strsql
CurrentDb.Execute strsql, dbFailOnError
LinkCriteria = "[CompanyID]=" & Me!CboCompanyID & " and [ContactFirst]=" & Me!CboContactID
DoCmd.OpenForm "ContactFrm", , , LinkCriteria
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub
And when it runs, i get this error:
You cannot add or change a record because a related record is required in table "TitleTbl"
I do have a title field in the table but it is not set to required.