Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Definitions & Auto Numbers

Status
Not open for further replies.
Aug 9, 2001
23
0
0
GB
2 queries really.

I have the following simple code to produce a table in code with a unique primary key:

Set tdf = DB.CreateTableDef(strTempSR)
Set fld = tdf.CreateField("ID", dbInteger, 3)
tdf.Fields.Append fld
DB.Execute "CREATE UNIQUE INDEX PrimaryKey ON " & strTempSR & " (ID)"

What I want to do is create another field as an autonumber, and then sort the table by the autonumber but I'm not sure how to do it.

Any help is greatly appreciated.

Thom.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top