Hi!
This procedure is ready for use. You may copy following codes into any module of your database and run procedure like example.
Example:
call FieldCreateInExistTable(currentdb,currentdb.TableDefs("Test"

,"NewField",dbLong,,2,"NewField"
Sub FieldCreateInExistTableUni(dbs As Database, tdf As TableDef, strFldName As String, Optional lngType As Long = dbText, Optional intSize As Integer = 0, Optional intPosition As Integer = 0, Optional strIdxName As String = ""

'This procedure create new field in the existing table,
'create new index if it is need
'and set the position of new field in the table.
'If you'll omit optional parameters (lngType or/and intSize,
'its will be created new field with type "Text" and size=50.
'If you'll omit optional parameter index for this field
'index will be not created
Dim fld As Field
Dim idx As Index
Dim prp As Property
Dim i As Integer
'Create new field
If lngType = dbText Then
If intSize = 0 Then
intSize = 50
End If
Set fld = tdf.CreateField(strFldName, lngType, intSize)
ElseIf lngType <> 0 Then
If intSize = 0 Then
Set fld = tdf.CreateField(strFldName, lngType)
End If
Else
Set fld = tdf.CreateField(strFldName)
End If
tdf.Fields.Append fld
tdf.Fields.Refresh
'Change new field's position in the table
If intPosition >= tdf.Fields.Count Then
intPosition = 0
End If
If intPosition <> 0 Then
Set prp = fld.Properties("OrdinalPosition"

prp.Value = intPosition
End If
'Create index of new field
If strIdxName <> "" Then
Set idx = tdf.CreateIndex(strIdxName)
With idx
.Fields.Append .CreateField(strFldName)
End With
tdf.Indexes.Append idx
tdf.Indexes.Refresh
End If
End Sub
Best regards!
Aivars