I have this porcedure after update to get the next REQNO. Its working fine but after reaching the 1000 reqno it became slower to get the next number. Can someone help me to fasten the process??
Thanks
Dim rst As dao.Recordset
Dim intCnt As Long
Set rst = CurrentDb().OpenRecordset("stock", dbOpenDynaset)
For intCnt = 1 To 5000
rst.FindFirst "[reqno]=" & intCnt
If rst.NoMatch Then
Me.ReqNo = intCnt
DoCmd.RunCommand acCmdSaveRecord
Exit Sub
End If
Next
End Sub
Thanks
Dim rst As dao.Recordset
Dim intCnt As Long
Set rst = CurrentDb().OpenRecordset("stock", dbOpenDynaset)
For intCnt = 1 To 5000
rst.FindFirst "[reqno]=" & intCnt
If rst.NoMatch Then
Me.ReqNo = intCnt
DoCmd.RunCommand acCmdSaveRecord
Exit Sub
End If
Next
End Sub