Subject Override: Finding next autoincrement value in Access Database
I only have a few hours left before I pass this project and Im having a hard time.. pls pls pls help me..
Heres the problem.. I have an Access database that contains a table named Customer.. now, as an attribute of that table, I have a customer ID that is an autonumber.. When I add a customer in my windows application at run time I want the system to display the customer number for that new customer..
Since I havent inserted a customer yet.. there is no row to select.. is it possible to get the next autonumber?
I tried DataTable.Row.Count and then go to the dataTable (count-1)(0) to get the last customer ID autonumber then plus 1 for the next new customer.. however it failed when I deleted a customer because when I created a new customer the customer ID it displayed is the last row of the table + 1 which is not the right autonumber of the new customer..
I need help asap pls pls pls pls.... this will really mean soooo much to me.. thank you so much.. and God bless all of you!
I only have a few hours left before I pass this project and Im having a hard time.. pls pls pls help me..
Heres the problem.. I have an Access database that contains a table named Customer.. now, as an attribute of that table, I have a customer ID that is an autonumber.. When I add a customer in my windows application at run time I want the system to display the customer number for that new customer..
Since I havent inserted a customer yet.. there is no row to select.. is it possible to get the next autonumber?
I tried DataTable.Row.Count and then go to the dataTable (count-1)(0) to get the last customer ID autonumber then plus 1 for the next new customer.. however it failed when I deleted a customer because when I created a new customer the customer ID it displayed is the last row of the table + 1 which is not the right autonumber of the new customer..
I need help asap pls pls pls pls.... this will really mean soooo much to me.. thank you so much.. and God bless all of you!
Last edited by a moderator: