Hi I will like to allow duplicate entry but the user must choose if he still wants to continue.<br>
<br>
I would like something like this I got from online if the data is not in the list it will prompt to add the data.<br>
<br>
Code:
<br>
Private Sub CompanyInfo_ID_NotInList(NewData As String, Response As Integer)<br>
On Error GoTo myError<br>
<br>
Dim rst As DAO.Recordset<br>
<br>
Set rst = CurrentDb.OpenRecordset("CompanyInfo", dbOpenDynaset)<br>
<br>
If vbYes = MsgBox("Company name is not in the list. Do you wish to add " _<br>
& NewData & " as a new Company?", _<br>
vbYesNo + vbInformation, _<br>
"New Company") Then<br>
<br>
rst.AddNew<br>
rst!CompanyName = NewData<br>
rst.Update<br>
<br>
Response = acDataErrAdded<br>
<br>
Else<br>
<br>
Response = acDataErrContinue<br>
<br>
End If<br>
<br>
leave:<br>
<br>
<br>
If Not rst Is Nothing Then<br>
rst.Close: Set rst = Nothing<br>
End If<br>
<br>
Exit Sub<br>
<br>
myError:<br>
<br>
MsgBox "Error " & Err.Number & ": " & Error$<br>
Resume leave<br>
End Sub<br>
<br>
<br>
<br>
I would like to put It in the afterupdate.