Setting a Field Sort for a Table

Kango

Registered User.
Local time
Today, 05:49
Joined
Mar 11, 2004
Messages
29
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
 
The only way you can sort a table is to order it via a query or via an AutoNumber.
 
Last edited:

Users who are viewing this thread

Back
Top Bottom