Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error Message

Status
Not open for further replies.

Jengo

Programmer
Apr 17, 2000
100
US
Everytime I try to run the code below I get the following error.

Run-time error '3211':

The database engine could not lock table 'Employee Table' because it is already in use by another person or process.

-------------------------------------

Dim dbs As Database
Dim tdf As TableDef
Dim fld As Field
Dim MySet As Recordset

DoEvents
Set dbs = CurrentDb()
Set MySet = dbs.OpenRecordset("Problem Calls")

MySet.MoveLast
MySet.MoveNext
MySet.AddNew

MySet.Fields("Problem Call") = txtProblemCall.Value
MySet.Update

Set MySet = Nothing
lstProblemCall.Requery
lstProblemType1.Requery

DoEvents
Set tdf = dbs.TableDefs("Employee Table")
Set fld = tdf.CreateField(txtProblemCall.Value, dbText)

tdf.Fields.Append fld <----- Error
tdf.Fields.Refresh

DoEvents
Set tdf = dbs.TableDefs(&quot;Problem Types&quot;)
Set fld = tdf.CreateField(txtProblemCall.Value, dbText)
tdf.Fields.Append fld
tdf.Fields.Refresh

Set tdf = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top