I have seen a number of responses to other questions that indicate I should be able to do the following to insert a new record into an Access 2007 database and have my primary key autonumber field populated automatically:
What actually happens is that a record is inserted into my table, but the primary key (which is autonumbered) is left blank. Can anyone explain why this might be happening. The primary key is not contained in the insert.
Code:
INSERT INTO D_INVOICE (Org_Code, Prog_Code, [Year], Balance, Base_Rate, Affiliate_Rate, Cost_Per_Intern, Number_of_Interns, Date_of_Invoice, Date_Due, Date_Paid, Amount_Paid, Credit_Offset, Entered_By ) SELECT Org_Code, Prog_Code, Year, Balance, Base_Rate, Affiliate_Rate, Cost_Per_Intern, Number_of_Interns, Date_of_Invoice, Date_Due, "" AS Date_Paid, "" AS Amount_Paid, Credit_Offset, [Entered By] AS Entered_By FROM q_org_invoicing_records;
Comment