473,472 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

OverFlow - Runtime Error 6

63 New Member
Expand|Select|Wrap|Line Numbers
  1.   Dim tempLeft As Long
  2.   Dim tempWidth as integer
  3.  
  4.   tempLeft = Round(((tempWidth - i) * 100) / 18.39, 1)
  5.  
Hi,

When I try to run this code and when tempWidth = 343, I get Runtime error 6 - overflow.

I have no idea how to get rid of it ... can anyone please help me with this??
Jan 12 '08 #1
1 2504
Killer42
8,435 Recognized Expert Expert
Use Long instead of Integer, perhaps.

Keep in mind, VB will do the calculation using the smallest data type it thinks it can get away with. So if you force all the values to be seen as Long (or Single, or anything big enough) it will work.

By the way, just out of curiosity, what data type is i? And while we're at it, the value?

Hm... what version of VB are you using? I just pasted your code into VB6, inserted tempWidth = 343 and it worked OK.
Jan 13 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: phong.lee | last post by:
Is there a reason why i keep getting this run time error, i never gotten it before. Can someone help me out with this? here is my code: With rstout 'first check if not on EOF If Not...
1
by: Maashoff | last post by:
Hi, Im trying to run an excel macro that consolidates data on multiple tabs onto a singe tab. (ie. create a database). I am consolidating a total of 82 tabs into one. The macro works fine until it...
5
by: creative1 | last post by:
Hi all. I got a problem in my .exe version of the software. I created package wizard. For one command button, it displays messge "Cancel transaction". When I click OK, program crashes and displays...
7
by: LucasLondon | last post by:
Hi, I have the code below that I adapted to loop through each column of data (Columns A to GR) to perform an a calculation based on the data in rows 2 to 31 of each column and place the...
3
by: grace01 | last post by:
My asp webpage was working well in the past 5 years. Recently it shows the message: Microsoft VBScript runtime error '800a0006' Overflow: 'addOrder' The source code is as follow: 'insert...
0
by: .nLL | last post by:
Erorr is --------------------- Microsoft VBScript runtime error '800a0046' Permission denied /a.asp, line 3 -----------------------
3
by: Jim Armstrong | last post by:
Hello all - This is driving me crazy. I have a table called tblClients - very simple, has the following fields: taxID (PK) ClientName SalesName The main form of my application allows a...
3
by: suganya | last post by:
Hi Some professionals already has developed the project using menu. In my company, they have given me task to clear the error in that. It is a script file named as "menubarAPI4.js" which is kept...
5
by: munkee | last post by:
Hi all, I am using a form to basically display monthly and fiscal year to date figures. I use the following code in the submit button (combo boxes populare year, month, department and incident...
0
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,...
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,...
0
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...
0
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...
0
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,...
0
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...
0
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 ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.