473,796 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Cl ick()
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.OpenRecordse t(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 6709
"Steve Fraser" <sf*****@tay.co m> wrote in message
news:fE******** *******@news.us west.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_Cl ick()
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.OpenRecordse t(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
5179
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 direction? thanks James
3
4932
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 filename.py
4
3217
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 my root directory, but I can run asp files from the root directory of my website and I can run htm files from the subdirectories. If I run localhost/mytest.asp
2
2544
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: ManipulateData(const char* Path-To-Some-Text-File) { ... }
2
3688
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 start will use the existed process. So only one application run. I can use mouse to run this application twice, and there are two A.exe processes in processed pool. So how can i do the same work using code but not manu-click?
6
20088
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 quite a few words in this post but the questions are actually quite similar and should be fairly quick to answer ... (1) What is Happening with the Threads
13
5097
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 only 1 thread per line Trunk_Thread.ApartmentState = ApartmentState.STA
9
4691
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. When I put in a break point the program does not stop. It is in debug mode. If I change the program.cs file back to the form that was originally being used. The program does go into debug mode. But if I change code in that file it isn't using...
8
3023
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? -- thanks - dave david_at_windward_dot_net http://www.windwardreports.com
3
11303
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
10453
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10172
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9050
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.