Good Morning!~
I've been working on this database since 3am...no sleep...ugh.
OK, I have the following On Not in List:
Private Sub Country_NotInList(NewData As String, Response As Integer)
Dim db As DAO.Database, rst As DAO.Recordset
Dim Msg As String, Style As Integer, Title As String, DL As String
DL = vbNewLine & vbNewLine
Msg = "'" & NewData & "' is not an available item " & DL & _
"Do you want to add this item to the current list? " & DL & _
"Click Yes To Add " & NewData & " to the list" & DL & _
"Click No to re-type it."
Style = vbQuestion + vbYesNo
Title = "Add New Item?"
If MsgBox(Msg, Style, Title) = vbNo Then
Me![Country].Undo
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rst = db.OpenRecordset("TblCountries", dbOpenDynaset)
rst.AddNew
rst![Countries] = NewData
rst.Update
Response = acDataErrAdded
End If
Set rst = Nothing
Set db = Nothing
End Sub
Works Great!~
But I have another form that uses the same Country Table that I need to be able to do a On Not in List.
I keep getting th Automation Error and the VBA screen goes straight to the above code, it will not let me input another one.
I guess this is the first time I have ever done this before!~
Is it possible? Do I just need to forgo the On Not in List on the Second Form?
Thanks!~