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

Is it possible to add a autonumber to an existing table?

Status
Not open for further replies.

12donkeys

Technical User
Oct 3, 2005
3
US
Is it possible to add a autonumber to an existing table? If so how do i do this.
 
In design view of the table, add a column and select autonumber as the data type.

If you want to do this through VBA, use

Code:
Dim mySql As String
mySql = "ALTER TABLE tblCust ADD Column myCounter COUNTER;"
DoCmd.RunSQL mySql

The above code will add an autonumber field named myCounter to the tblCust table.

HTH

John

Use what you have,
Learn what you can,
Create what you need.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top