I am having so many problems with Access, using the not in list event.
I have tried so many ways of doing it but just kept getting repeated notices of do you want to add etc etc etc and then finally getting the record could not be saved this time, despite it being saved.
Then I found some code that worked in someone else's download. It had all the same references as I had in Access, and worked. However using the code in my Access it failed. However when I imported the example form into my db, my form started working. However it's stopped now. So I re imported the demo example in again and it worked for a few times, and then now fails again.
How can I check my version of Access is ok? I have reinstalled twice with no difference.
I have tried so many ways of doing it but just kept getting repeated notices of do you want to add etc etc etc and then finally getting the record could not be saved this time, despite it being saved.
Then I found some code that worked in someone else's download. It had all the same references as I had in Access, and worked. However using the code in my Access it failed. However when I imported the example form into my db, my form started working. However it's stopped now. So I re imported the demo example in again and it worked for a few times, and then now fails again.
How can I check my version of Access is ok? I have reinstalled twice with no difference.
Code:
Private Sub Combo3_NotInList(NewData As String, Response As Integer)
Dim strsql As String, x As Integer
x = MsgBox("Do you want to add this Keyword to the list?", vbYesNo)
If x = vbYes Then
strsql = "Insert Into KeywordTable ([Keyword]) values ('" & NewData & "')"
CurrentDb.Execute strsql, dbFailOnError
Response = acDataErrAdded
Else
Response = acDataErrContinue
End If
End Sub