Hi,
I get an error (no. 3211) when I try to add a new field
into an access data base with the append method. This is the code:
db = ... to define
<---error 3211
I get an error (no. 3211) when I try to add a new field
into an access data base with the append method. This is the code:
Code:
Private Sub UpdateField(ByVal newFieldName As String)
Dim db As database
Dim td As TableDef
Dim fl As Field
Dim bFieldName As Boolean
Code:
For Each fl In db.TableDefs("AllUsers").Fields
If fl.Name = newFieldName Then
bFieldExists = True
Exit For
End If
Next fl
If Not bFieldExists Then
'create field
Set td = db.TableDefs("AllUsers")
If Not td.Updatable Then
MsgBox "TableDef not Updatable! ", vbInformation, "Cannot update !"
Exit Sub
End If
Set fl = td.CreateField(newFieldName, dbText)
td.Fields.Append fl
Code:
End If
End Sub