REPOST:
how to generate auto number in msaccess[
^]
First of all I would say, use
AutoNumber
datatype for your ID field.
For this question, you had closed it wrong.
INSERT INTO tblDBUser (intDBUserId, strLogin,strName,strPassword,intDBRoleType)
values((select MAX(intDBUserId)+1 from tblDBUser), strLogin,strName,strPassword,intDBRoleType);
If you use AutoNumber, you have to use following only. intDBUserId will automatically be generated.
INSERT INTO tblDBUser (strLogin,strName,strPassword,intDBRoleType)
values(strLogin,strName,strPassword,intDBRoleType);