Dim rs As Recordset, nextId As Long
Set rs = con.Execute("SELECT Max(emp_id) As LastID FROM theTable")
nextId = 1
If rs.RecordCount <> 0 Then
nextId = rs!LastID
End If
nextId = nextId + 1
Dim rs As Recordset, nextId As Long
Set rs = con.Execute("SELECT Max(emp_id) As LastID FROM theTable")
nextId = 1
If rs.RecordCount <> 0 Then
nextId = rs!LastID
End If
nextId = nextId + 1
Using the right shift (>>) operator is the quicker, if not the quickest, method.