To append a field to a table, add it to the TableDef, not to a Recordset.
Dim db As DAO.Database
Dim tdf As TableDef
Dim fld As DAO.Field
Set db = CurrentDb()
Set tdf = db.TableDefs("MyTable")
Set fld = tdf.CreateField("MyField, dbText)
tdf.Fields.Append fld
For the field type, make sure you use the DAO constants, not the ADOX
constants.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Earl" <womenfo@mindspring.com> wrote in message
news:htROb.18312$OM2.4130245@news4.srv.hcvlny.cv.n et...[color=blue]
> How do I add a new field to a table. the code below gives a type mismatch
> error
>
> ---------------
> Dim db As DAO.Database
> Dim rs As DAO.Recordset
>
> Set db = CurrentDb
> Set rs = db.OpenRecordset("mytable", dbOpenDynaset)
>
> rs.Fields.Append "test", adChar[/color]