I have a table that holds Employee Information which includes the following fields: EmployeeID(Auto Number), EmployeeNo(Long Integer), EmployeePin(Lon g Integer), and EmployeeName(Te xt). I assign employee numbers in increments of 10. (i.e. 10, 20, 30, 40...)
I use the following code in a form's on load event to to assign a unique employee number to the EmployeeNo Field.
The problem is that once I have an employee number of 90 my code never produces a number higher than 100. I know what's happening and how Access sees numbers in the following order 10, 100, 20, 30, 40....80, 90.
My question how can i get my access query or SQL statement to see 100 as the highest number instead of 90.
I use the following code in a form's on load event to to assign a unique employee number to the EmployeeNo Field.
Code:
strSQL = "SELECT TOP 1 EmployeeNo FROM tblEmployees ORDER BY tblEmployees.EmployeeNo DESC;" Set rs = CurrentDb.OpenRecordset(strSQL) Dim NewEmpNo As Long NewEmpNo = rs.Fields("EmployeeNo") Me.txtEmpNo = NewEmpNo + 10
My question how can i get my access query or SQL statement to see 100 as the highest number instead of 90.
Comment