The following code produces the error: The database engine could not lock
table 'printout' because it is already in use by another person or process.
Any ideas why I am getting this error and how I can fix it? Thanks!
Dim tblName As TableDef
Dim strFieldName As String
Dim intFieldType As Integer
Dim lngAttributes As Long
Dim intMaxLength As Double
Dim tmpNewField As Field
Set tblName = dbMyDB.TableDefs("printout")
strFieldName = "ID"
intFieldType = dbLong
lngAttributes = dbAutoIncrField
intMaxLength = 100
Set tmpNewField = tblName.CreateField(strFieldName, intFieldType,
intMaxLength)'
tmpNewField.Attributes = lngAttributes
tblName.Fields.Append tmpNewField
|