I am attempting to create a table with an index. however, i am receiving an error code "3371: Cannot find table or constraint" as soon as it reads the "create index" statement. The code is as follows"
thank you in advance for any guidance.
thank you in advance for any guidance.
Code:
strSeqNumber_TEMP = " "
strIndexOrg_TEMP = "0"
strFund_TEMP = " "
strAccountCode_TEMP = "0"
strTotalPrice_TEMP = "0"
strInd_TEMP = "0"
strRuleCode_TEMP = "0"
strSalesOrder_TEMP = "0"
Dim tbl_IDT As DAO.TableDef
Dim idxSeqNumber As DAO.Index
'**** create output table
'Delete temporary table
DoCmd.RunSQL "DROP TABLE tbl_IDT;"
'Create temporary table
CurrentDb.Execute ("CREATE TABLE tbl_IDT(SeqNumber smallint, IndexOrg smallint, " & _
"Fund VARCHAR(6), " & _
"AccountCode smallint, " & _
"TotalPrice money, " & _
"Ind VARCHAR(1), " & _
"RuleCode VARCHAR(6), " & _
"SalesOrder numeric)")
DoCmd.RunSQL "CREATE INDEX idxSeqNumber ON tblIDT (SeqNumber) WITH PRIMARY"
Comment