Move Column Position use Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can i use a query to move last column (Field) to second column?

my example but doesn't work
DoCmd.RunSQL "ALTER TALBE [TABLE NANE] ALTER [MyField] POSITION = 1"

Thank you.
 
Try this:

Dim db as DAO.Database
Dim tbl as TableDef
Set db = CurrentDb
Set tbl = db.TableDefs("TableName")
tbl.Fields("MyField").OrdinalPosition = 1

Note: you will need to add an appropriate DAO reference, if not already
included.

HTH,
Nikos
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top