I am trying to do this as the previous attempt with recordsets failed. Here is my code. It is from the submit button on an Access form. The user enters data into the required fields and hits submit which should update the table.
--------------------------------
Private Sub Add_Click()
Dim cmd As ADODB.Command
Dim strSQL As String
Set cmd = New ADODB.Command
strSQL = "INSERT INTO tbl_target (Date, Department, Division, Section, Target) VALUES (TarDate, Dept, Division, Section, AdTarget)"
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = strSQL
cmd.Execute
End Sub
------------------------------
Thx for any help _______________
Stretchy
--------------------------------
Private Sub Add_Click()
Dim cmd As ADODB.Command
Dim strSQL As String
Set cmd = New ADODB.Command
strSQL = "INSERT INTO tbl_target (Date, Department, Division, Section, Target) VALUES (TarDate, Dept, Division, Section, AdTarget)"
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = strSQL
cmd.Execute
End Sub
------------------------------
Thx for any help _______________
Stretchy