Hello I am trying to input data on the same row in my vba script. One set of data is being pulled from the Form and another set is within variables.
Can someone please help fix my code?
Code:
Private Sub Enter_Data_Click()
Dim sSql As String
On Error GoTo Enter_Data_Click_Err
On Error Resume Next
DoCmd.GoToRecord , "", acNewRec
sSql = "INSERT INTO 04Event_Collector ([EVENT_DATE],[USER],[MACH]) VALUES (#" & Now() & "#, '" & TempVars!pvUserUser & "','" & TempVars!pvMach_Area & "')"
Debug.Print sSql
CurrentDb.Execute sSql, dbFailOnError
If (MacroError <> 0) Then
Beep
MsgBox MacroError.Description, vbOKOnly, ""
End If
Enter_Data_Click_Exit:
Exit Sub
Enter_Data_Click_Err:
MsgBox Error$
Resume Enter_Data_Click_Exit
End Sub
Thank you