I'm trying to insert a set of values into a table using SQL.
Here's my code:
However, this returns a compile error.
I reference User as Environ("USERNAME") earlier in the code. Everything else pulls from the current table ("tblInventory").
I'm lost, since I've never attempted to use SQL in VBA.
Here's my code:
Code:
DoCmd.RunSQL "INSERT INTO tblAuditTrail([DateTime], [UserName], [RecordID], [Action], [FieldName], [OldValue], [NewValue])VALUES (" & Now() & ", " & User & ", & Me.CSM & ", " & 'EDIT' & ", " & 'Location' & ", " & Me.txtTranFrom & ", " & Me.txtTranTo & ");"
However, this returns a compile error.
I reference User as Environ("USERNAME") earlier in the code. Everything else pulls from the current table ("tblInventory").
I'm lost, since I've never attempted to use SQL in VBA.