I'm using the following code to append a new field to an existing
table in an MDB file.
Set td = db.TableDefs("MainData")
Set fld = New Field
fld.Name = "NewFieldName"
fld.Type = dbInteger
td.Fields.Append fld
This, of course, adds the new field at the end of the list of current
fields.
What I would like to do is INSERT the new field at a specified place
in the list of existing fields. Is it possible to do this? If so, how?
Thanks.
roame - 13 Jul 2008 11:56 GMT
> I'm using the following code to append a new field to an existing
> table in an MDB file.
[quoted text clipped - 12 lines]
>
> Thanks.
Do you have a syntax table for your compiler?
Douglas J. Steele - 14 Jul 2008 01:40 GMT
What difference does it make? I'm not trying to be facetious, but really
where the field is in the table shouldn't matter. If you've got some
specific output that you want in a specific order, use a query with the
fields arranged as you need.
If you're really determined to change it, though, take a look at the
OrdinalPosition property.

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> I'm using the following code to append a new field to an existing
> table in an MDB file.
[quoted text clipped - 12 lines]
>
> Thanks.