Dear Group
I am trying to automate process of adding a new record id in my form using
the following code when the user clicks the "Add New Record" button. For
example if the last record id is "2005001" then I want to increment this by
one so that new value is "2005002" and place it in the record id field for
the new record on the form. I've tried using the following code but get the
message "Overflow" when I run the code. Can't find on the online help what
this means. Not sure if the logic is correct in the code? Any pointers or
ideas would be much appreciated.
Code:
On Error GoTo Err_Command623_Click
Dim intlastrecID As Integer
DoCmd.GoToRecord , , acLast
intlastrecID = PropID.Value
DoCmd.GoToRecord , , acNewRec
PropID.Value = intlastrecID + 1
Exit_Command623_Click:
Exit Sub
Err_Command623_Click:
MsgBox Err.Description
Resume Exit_Command623_Click
Many thanks in advance