Run-time error '6' Overflow



I am wondering if anyone can help me out. I have an Access Database that
has been running since forever. Now when I try to open a form I get the
"Run-time error '6' Overflow message and a window asking me to debug or
end. Here is what i see on debug:

Private Sub CmdPeopleAdd_Click()
Dim db As Database
Dim Rs As Recordset
Set db = CurrentDb
Dim SQL As String
Dim i As Integer
Set db = CurrentDb
SQL = "SELECT ID FROM Clients ORDER BY ID;"
Set Rs = db.OpenRecordset(SQL)
Rs.MoveLast
i = Rs!ID + 1 ' Increment the number by one
Rs.AddNew
Rs!ID = i
Rs.Update
Rs.Close
db.Close
DoCmd.OpenForm "FrmPeople", , , , , , i
End Sub

The highlighted area to debug is i = Rs!ID + 1 ' Increment the number by
one.

Thank you,
sf

*** Sent via Developersdex http://www.developersdex.com ***
.



Relevant Pages

  • Re: Error 91 help required
    ... statement as you did for the recordset object. ... Not sure if CurrentDB is a reserved word, ... Dim db As DAO.Database ... > Private Sub cmdSubmit_click ...
    (microsoft.public.access.modulesdaovba)
  • Re: Error 91 help required
    ... If you run the query through the interface, ... Not sure if CurrentDB is a reserved word, ... >>> Private Sub cmdSubmit_click ... >>> Dim rs As DAO.Recordset ...
    (microsoft.public.access.modulesdaovba)
  • RE: Forms are fun (except when they need combo box VBA code I don
    ... Private Sub AgentName_NotInList(NewData As String, Response As Integer) ... Dim db As Database ... Set db = CurrentDb ...
    (microsoft.public.access.formscoding)
  • Re: Populate a combo box
    ... Private Sub UserForm_Initialize ... Dim rs As DAO.Recordset ... ' Load the ListBox with the retrieved records ... > I would like to have this done from a table in an Access database. ...
    (microsoft.public.word.vba.general)
  • Run-time error 6 Overflow
    ... I have an Access Database that ... Private Sub CmdPeopleAdd_Click ... Dim Rs As Recordset ... Set db = CurrentDb ...
    (comp.databases.ms-access)