If the value is new I want to add it to the table and I have tried couple scripts I found online but it always comes out with an error. This is script that i would like as I seem to understand it more or less:
Expand|Select|Wrap|Line Numbers
- Private Sub Update_frequency_NotInList(NewData As String, Response As Integer)
- Dim db As Database
- Set db = CurrentDb
- 'Add the new value to the field
- db.Execute "INSERT INTO tblFrequency (Update_Frequency) VALUES (""" & NewData & """)", dbFailOnError
- 'Tell Access you've added the value
- Response = acDataErrAdded
- db.Close
- Set db = Nothing
- End Sub
Any ideas on what could be the problem? I am using Access 2000