I have created a drop down menu (keywords) that list all my entries from my database. I also have a text field (newkeyword) and a Add keyword button (addkeyword). All I am trying to do is add the new keyword to the database and update the drop down menu. My code is as follows.
<SCRIPT LANGUAGE = "VBScript">
<!--
Option Explicit
Private Sub addkeyword_Click()
On Error GoTo Err_addkeyword_Click
newkeyword.SetFocus
DoCmd.RunSQL "INSERT INTO Keywords (KeywordText) VALUES ('" + newkeyword.Text + "')"
keywords.Requery
Exit_addkeyword_Click:
Exit Sub
Err_addkeyword_Click:
MsgBox Err.Description
Resume Exit_newkeyword_Click
-->
</SCRIPT>
This is the first time I have attempted such a thing and I have simply ported code from Access. This code doesn't work, please help.
Thankyou in advance
<SCRIPT LANGUAGE = "VBScript">
<!--
Option Explicit
Private Sub addkeyword_Click()
On Error GoTo Err_addkeyword_Click
newkeyword.SetFocus
DoCmd.RunSQL "INSERT INTO Keywords (KeywordText) VALUES ('" + newkeyword.Text + "')"
keywords.Requery
Exit_addkeyword_Click:
Exit Sub
Err_addkeyword_Click:
MsgBox Err.Description
Resume Exit_newkeyword_Click
-->
</SCRIPT>
This is the first time I have attempted such a thing and I have simply ported code from Access. This code doesn't work, please help.
Thankyou in advance