473,386 Members | 1,958 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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 ***
Feb 28 '06 #1
1 6670
"Steve Fraser" <sf*****@tay.com> wrote in message
news:fE***************@news.uswest.net...
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


I guess you have now added so many clients that the number can no longer be
held by an integer. Changing the line
Dim i As Integer
to
Dim i As Long
should fix the immediate problem. There are other comments we could make on
the code, but get that bit fixed first.
Feb 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: James | last post by:
Hi, I would like to run a custom script on a linux box via a button on a php page (php webpage hosted on the same linux box). Is this possible? If so , can you give me a pointer in the right...
3
by: leroybt.rm | last post by:
Can someone tell me how to run a script from a interactive shell I type the following: >>>python filename >>>python filename.py >>>run filename >>>run filename.py >>>/run filename >>>/run...
4
by: Ed | last post by:
Hello, I took a course in asp about 2 years ago and I was practicing with IIS 5.0. Then I put it down for a while. Now trying to get back to it. I can't run asp files from subdirectories of...
2
by: Jenna Olson | last post by:
Hi all- I've never seen this particular issue addressed, but was wondering if there's anything to support one way or another. Say I have a class: class ManipulateData { public:...
2
by: Napo | last post by:
Hi: i build a .net application named A.exe. I need run this application twice using c# code in another application. i try to use process.start(A.exe) twcie, but it failed. Because the second...
6
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
9
by: Brett Wesoloski | last post by:
I am new to VS2005. I changed my program.cs file to be a different form I am working on. But when I go to run the application it still brings up the form that was originally declared as new. ...
8
by: David Thielen | last post by:
Hi; In our setup program how do I determine if I need to run "aspnet_regiis –i" and if so, is there an API I can calll rather than finding that program on the user's disk and calling it? --...
3
by: traceable1 | last post by:
Is there a way I can set up a SQL script to run when the instance starts up? SQL Server 2005 SP2 thanks!
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.