I'm struggling with a Syntax error on the code below. This code below is in the Add Record view, After Record Added event. I believe it has something to do with the ReportID which is an Integer value. The ReportID is the primary key of the record, which I want to take and insert into a tblmasterlog together with the [Type], [Created_By] and [Purpose] field names. All the other text (varchar) fields are inserting fine into the secondary table, but the ReportID is giving errors. Any assistance is greatly appreciated.
//** Insert a record into another table ****
global $conn;
$strSQLInsert = "insert into tblmasterlog (Type, ReferenceID, Originator, Description)
values ('".$values["Type"]."', ".$values[Report_ID].", '".$values["Created_By"]."', '".$values["Purpose"]."')";
db_exec($strSQLInsert,$conn);
// Place event code here.
// Use "Add Action" button to add code snippets.