Autonumber

torg

Well-known member
Joined
Nov 7, 2002
Messages
60
Location
Norway
In an access db.
I wish to create a database table in access. I whish the pk:Expence_ID
to be autonumbered. How do I do that in sql code in access?

Code:
create table testing5(Expence_ID number,Expencetype Text not null, To text, Dato Date not null, Commenttext(30), Amount currency not null,  constraint pk1 primary key(Expence_ID));
 
I solved the problem:

Used autoincrement

Code:
create table testing5(Expence_ID autoincrement,Expencetype Text Not Null, To text, Dato Date Not Null, Commenttext(30), Amount Currency Not Null,  constraint pk1 primary key(Expence_ID));
 
Back
Top