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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an autonumber field

Status
Not open for further replies.

siftach

Programmer
Jul 22, 2003
78
IL
I want to create a table through VB code in access by creating a new TableDef and the a new Field:

Dim dbs As DAO.Database, tdf As TableDef, fld As Field
Set dbs = DBEngine.Workspaces(0).OpenDatabase("C:\db1.mdb")
Set tdf = dbs.CreateTableDef("tblTask2Stud")
Set fld = tdf.CreateField("Task2StudID", dbInteger)

Now how do I make this field an autonumber?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top