I run this code from a button on a form.. When I run the code it gives me an error ‘Run-Time error ‘3134’ Syntax error in INSERT INTO statement.. Obviously the error deals with the INSERT INTO part of the SQL statement, but I checked the “SELECT” part of the SQL and it does pull the data I need.. So that part is correct.. Program is a string for the name of the table I want to insert the data into.. Appendtable is a string for the name of the table I want to select the data from… I even tried building the SQL as an append query and using that SQL but I got the same error.. Any thoughts? Thanks
Dim Program As String
Dim AppendTable As String
Program = pgmtbl
AppendTable = Program & “Resolutiontbl”
DoCmd.RunSQL “INSERT INTO ” & Program & “SELECT ” & AppendTable & “.[Voucher#],” & AppendTable & “.[First Name],” & AppendTable & “.[Last Name],” & AppendTable & “.[Appt#] FROM ” & AppendTable & ”