G
Guest
I want to write code that increments items in a recordset by 1.
Here are the criteria:
ItemID (ITEMS table) is a derivative of its owning employee's ID + a
1-letter suffix (increments by 1, providing up to 26 items per employee)
EmployeeID (EMPLOYEES table) is a derivative of the department's ID + a "-"
and a 2-digit suffix (increments by 1). If there are more than 99 employees,
the next value would be A0, A1, A2… A8, A9, B0, B1, B2… (Providing 359
possible employees per department)
DepartmentID (DEPARTMENT table) is always associated with a company ID and
is a "-" and a 4-digit suffix (not necessarily unique)
CompanyID (COMPANY table) is a 4-digit number (unique).
Therefore:
One could look at an item's ID and derive from that the employee to whom it
belongs (as well as the company and department):
1111-2222-01A
One could look at an employee's ID and derive from that the company and
department to which they belong:
1111-2222-01
One could look at a department ID and derive the company:
1111-2222
How do I increment the EmployeeID automatically by 1 (following the criteria
above… always 2 digits with possible alpha)
How do I increment the ItemID automatically by 1 (following the criteria
above… always alpha)
Regards,
John
Here are the criteria:
ItemID (ITEMS table) is a derivative of its owning employee's ID + a
1-letter suffix (increments by 1, providing up to 26 items per employee)
EmployeeID (EMPLOYEES table) is a derivative of the department's ID + a "-"
and a 2-digit suffix (increments by 1). If there are more than 99 employees,
the next value would be A0, A1, A2… A8, A9, B0, B1, B2… (Providing 359
possible employees per department)
DepartmentID (DEPARTMENT table) is always associated with a company ID and
is a "-" and a 4-digit suffix (not necessarily unique)
CompanyID (COMPANY table) is a 4-digit number (unique).
Therefore:
One could look at an item's ID and derive from that the employee to whom it
belongs (as well as the company and department):
1111-2222-01A
One could look at an employee's ID and derive from that the company and
department to which they belong:
1111-2222-01
One could look at a department ID and derive the company:
1111-2222
How do I increment the EmployeeID automatically by 1 (following the criteria
above… always 2 digits with possible alpha)
How do I increment the ItemID automatically by 1 (following the criteria
above… always alpha)
Regards,
John