Oct 4, 2005 #1 12donkeys Technical User Joined Oct 3, 2005 Messages 3 Location US Is it possible to add a autonumber to an existing table? If so how do i do this.
Oct 4, 2005 #2 BoxHead Technical User Joined May 6, 2001 Messages 876 Location US 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. Upvote 0 Downvote
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.