Sometimes I am too impatient to wait for my message to post and in that time
I keep digging and find alternative solutions. This is what I ended up using
for that control. It works fine. I can still show the Append2 code if you
would like, but this works so I am fine now. :-)
Thanks, Lee
Private Sub City_NotInList(NewData As String, Response As Integer)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strMsg As String
Dim City As AccessObject
strMsg = "'" & NewData & "' is not in our list. " & vbCrLf & vbCrLf
strMsg = strMsg & "Do you want to add " & NewData & " to the list? "
strMsg = strMsg & vbCrLf & vbCrLf & "Click Yes to add or No to re-type it.
"
If MsgBox(strMsg, vbQuestion + vbYesNo, "Add new name?") = vbNo Then
Set db = CurrentDb
Set rs = db.OpenRecordset("TBL_City", dbOpenDynaset)
Response = acDataErrContinue
Else
Set db = CurrentDb
Set rs = db.OpenRecordset("TBL_City", dbOpenDynaset)
On Error Resume Next
rs.AddNew
rs!City = NewData
rs.Update
If Err Then
MsgBox "An error occurred. Please try again."
Response = acDataErrContinue
Else
Response = acDataErrAdded
End If
End If
rs.Close
Set rs = Nothing
Set db = Nothing
End Sub
--
Message posted via
http://www.accessmonster.com