FORM Event Procedure - On Click - insert record to table

P

Paul Dennis

I have a form listing all [competency] details and when I press the button I
want a record inserting into table [Criteria] containg the [Competency Name]
& Competency_ID however I'm getting a syntax error. Can you help?

Dim stDocName As String
Dim rst As DAO.Recordset
Dim strSQL As String
Dim DB As DAO.Database

Set DB = CurrentDb
strSQL = "INSERT INTO Criteria " & _
"(GetValueT, GetValueN ) " & _
" WHERE GetValueT= Forms!a![Competency Name], GetValueN =
Forms!a!Competency_ID;"
DoCmd.RunSQL (strSQL)

stDocName = "Export - BAU"
DoCmd.RunMacro stDocName
 
Top