473,804 Members | 2,100 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 6710
"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
5180
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
3218
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
3689
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
5101
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
4693
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
3025
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
9712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
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
10341
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
10089
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
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4308
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3001
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.