Setting a Field Sort for a Table????
Hi All,
I have a table that is created from a user input form. This all works fine. How can I set the PaxNo field to be sorted first. The example below only creates one field, but actually about 7 fields are created, however i need the first field to be sorted first. i can do this manually by going in design , properties, order By. Can i do this through VBA?
im db As DAO.Database
Dim tblNew As DAO.TableDef
Dim fld As DAO.Field
Set db = CurrentDb
On Error Resume Next
Set tblNew = db.CreateTableDef(GlbTblName)
Set fld = tblNew.CreateField("PaxNo", dbInteger)
tblNew.Fields.Append fld
db.TableDefs.Append tblNew
Set tblNew = nothing
Set fld = nothing
Would be grateful for any advice!!!!!!!!
Thanks
Kango
Hi All,
I have a table that is created from a user input form. This all works fine. How can I set the PaxNo field to be sorted first. The example below only creates one field, but actually about 7 fields are created, however i need the first field to be sorted first. i can do this manually by going in design , properties, order By. Can i do this through VBA?
im db As DAO.Database
Dim tblNew As DAO.TableDef
Dim fld As DAO.Field
Set db = CurrentDb
On Error Resume Next
Set tblNew = db.CreateTableDef(GlbTblName)
Set fld = tblNew.CreateField("PaxNo", dbInteger)
tblNew.Fields.Append fld
db.TableDefs.Append tblNew
Set tblNew = nothing
Set fld = nothing
Would be grateful for any advice!!!!!!!!
Thanks
Kango