hollyylloh said:
I need to programatically set the order of fields in a table that will
later
be exported. I do not know where to start.
Hope you can help.
Try checking out the "OrdinalPosition" property of the field object.
This is a number which sets the field position. Multiple fields can have
the same "OrdinalPosition" value in which case they will appear in
alphabetical order by field name.
Be warned though, I have had problems using ordinal position in Access
2007.
For example, in a table with 5 fields, the following procedure will
incorrectly display a new field in the last position in Table View even
though it appears in the correct position in Design View:
1. Add a field, setting its ordinal position to make it the 2nd field.
2. Delete this field in Table View.
3. Add the field again.
If you delete the field in Design View instead of Table View (in step
2), then
all is well and the re-added field shows up in the correct position in
Table View also.
In the case where the field shows up incorrectly in the last position in
Table View, you can correct this by going into design view, moving the
field to a new location and then moving it back.
For some reason the field positions are not refreshed correctly when a
field is deleted in Table View.