2014-07-08 92 views
0

嘗試運行下面的代碼時,我總是收到一條錯誤消息,不斷將[CID PERSON ID]引用爲循環引用。插入聲明循環參考

 DoCmd.RunSQL "DELETE * from [tblOP_MASTER_FILE_PID]" 
     DoCmd.RunSQL "INSERT INTO [tblOP_MASTER_FILE_PID]" & _ 
        "SELECT [CID PERSON ID] from tblOP_MASTER_FILE" 

回答

0

您SQL

你的兩條線之間缺少空間
DoCmd.RunSQL "INSERT INTO [tblOP_MASTER_FILE_PID] " & _ 
-------------------------------------------------^ 
        "SELECT [CID PERSON ID] from tblOP_MASTER_FILE" 
0

略加修改,但得到它的工作

DoCmd.RunSQL "INSERT INTO tblOP_MASTER_FILE_PID ([Person ID])" & _ 
      "SELECT tblOP_MASTER_FILE.[CID Person ID] from tblOP_MASTER_FILE"