I'm using a database tracks company credit card usage by employees. One form, called Staff Maintenance, allows me to add or edit employee data, which updates the employee record in the Staff Table.
The key field in the Staff Table is StaffID, which is supposed to increment by +1 each time a new employee is added via the Staff Maintenance form. However, when I attempt to add an employee I receive an error message stating that the key field cannot contain a null.
I tried setting the key field default value to "0" but then when I try and add a new record I receive an error message stating that I'm attempting to create a record using a duplicate index value (the "0".
How can I have Access automatically increment the key field (Staff ID) by +1 each time a new record is add via the Staff Maintenance form? (For instance, there are 1050 records in the table, so the next Staff ID should be 1051.)
Thanks in advance for any help.
Kerry
The key field in the Staff Table is StaffID, which is supposed to increment by +1 each time a new employee is added via the Staff Maintenance form. However, when I attempt to add an employee I receive an error message stating that the key field cannot contain a null.
I tried setting the key field default value to "0" but then when I try and add a new record I receive an error message stating that I'm attempting to create a record using a duplicate index value (the "0".
How can I have Access automatically increment the key field (Staff ID) by +1 each time a new record is add via the Staff Maintenance form? (For instance, there are 1050 records in the table, so the next Staff ID should be 1051.)
Thanks in advance for any help.
Kerry