T
TeeSee
In the following code I INSERT the last name into the table and then
open it in edit mode to add the remaining information. When I close
the form I receive the message "The text you entered isn't an item in
the list.
LimitToList = yes
Could someone suggest a remedy please?
Could the row source query have a bearing on the problem?
Private Sub cboContactID_NotInList(NewData As String, Response As
Integer)
Dim strSQL As String
Dim x As Integer
x = MsgBox("Do you want to add this value to the list?", vbYesNo)
If x = vbYes Then
strSQL = "Insert Into tblContacts ([txtLastName]) values ('" &
NewData & "')"
' MsgBox strsql
CurrentDb.Execute strSQL, dbFailOnError
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
DoCmd.OpenForm "frmContactsAdd", acNormal, , "[txtLastName] ='" &
NewData & "'", acFormEdit, acDialog
End Sub
open it in edit mode to add the remaining information. When I close
the form I receive the message "The text you entered isn't an item in
the list.
LimitToList = yes
Could someone suggest a remedy please?
Could the row source query have a bearing on the problem?
Private Sub cboContactID_NotInList(NewData As String, Response As
Integer)
Dim strSQL As String
Dim x As Integer
x = MsgBox("Do you want to add this value to the list?", vbYesNo)
If x = vbYes Then
strSQL = "Insert Into tblContacts ([txtLastName]) values ('" &
NewData & "')"
' MsgBox strsql
CurrentDb.Execute strSQL, dbFailOnError
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
DoCmd.OpenForm "frmContactsAdd", acNormal, , "[txtLastName] ='" &
NewData & "'", acFormEdit, acDialog
End Sub