I am trying to use a SQL string to INSERT INTO a table. My sub reads as follows:
Private Sub makeTrans_Click()
Dim SQL As String
SQL = "INSERT INTO Transactions (TenantID, Date, Amount, Category, Notes) " & _
"VALUES ([TenantID].Value, [Date].Value, [Amount].Value, [Category].Value, [Notes].Value)"
DoCmd.RunSQL SQL
End Sub
When I call the sub, I get a run-time error '3134' saying I have invalid syntax in my INSERT INTO statement. I don't see anything wrong with the syntax. Is there something I'm missing?
Thanks.
Private Sub makeTrans_Click()
Dim SQL As String
SQL = "INSERT INTO Transactions (TenantID, Date, Amount, Category, Notes) " & _
"VALUES ([TenantID].Value, [Date].Value, [Amount].Value, [Category].Value, [Notes].Value)"
DoCmd.RunSQL SQL
End Sub
When I call the sub, I get a run-time error '3134' saying I have invalid syntax in my INSERT INTO statement. I don't see anything wrong with the syntax. Is there something I'm missing?
Thanks.