M
mconnolly4
Trying to create a primary key within a DAO access database from within VB
2005
The following code works but only if I turn off option strict
The line idxDesignTable.Fields.append(fldDesignIndex) is the source of the
problem.
Does anyone have an idea how I can recode to avoid the late bound issue
Thanks
Mike
'
'Create Primary Key Index Field
Dim idxDesignTable As Index
idxDesignTable = DesignTable.CreateIndex("KeyID" & "index")
Dim fldDesignIndex As Field
fldDesignIndex = idxDesignTable.CreateField("KeyID", dbLong)
idxDesignTable.Fields.append(fldDesignIndex) 'This line is the eror source
idxDesignTable.Primary = True
DesignTable.Indexes.Append(idxDesignTable)
'
2005
The following code works but only if I turn off option strict
The line idxDesignTable.Fields.append(fldDesignIndex) is the source of the
problem.
Does anyone have an idea how I can recode to avoid the late bound issue
Thanks
Mike
'
'Create Primary Key Index Field
Dim idxDesignTable As Index
idxDesignTable = DesignTable.CreateIndex("KeyID" & "index")
Dim fldDesignIndex As Field
fldDesignIndex = idxDesignTable.CreateField("KeyID", dbLong)
idxDesignTable.Fields.append(fldDesignIndex) 'This line is the eror source
idxDesignTable.Primary = True
DesignTable.Indexes.Append(idxDesignTable)
'