prvijesh
asked on
Get next Id from a table in MS Access
Hi guys,
I want to get the next id (primary key, autonumber) of table without using max(id). beacuse max(id) wont give the next id if the table contains no rows. i think some system table stores the next sequence of all auto number fields of tables. (in sqlite there is sequence table which holds the next id of all primary key(autoicrement) fileds). Any one know how to get the next id from system table in MS Access(2003, 2007).
Thanks
I want to get the next id (primary key, autonumber) of table without using max(id). beacuse max(id) wont give the next id if the table contains no rows. i think some system table stores the next sequence of all auto number fields of tables. (in sqlite there is sequence table which holds the next id of all primary key(autoicrement) fileds). Any one know how to get the next id from system table in MS Access(2003, 2007).
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
nz(dmax("ID", "tablename"),0)