473,406 Members | 2,710 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,406 software developers and data experts.

Overflow Error message

Hi All,
I get the overflow error message when I clicked in a button, but so
far I can't see anything wrong with the code below. Can anybody help?
I'm still a newbie with Access. Any help will be appreciated.

Private Sub Command63_Click()
On Error GoTo Err_Command80_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim Invoice As Integer

Invoice = Me![InvoiceID]
If IsNull(DLookup("[invoiceid]", "[Product]", "[invoiceid]=" &
Invoice)) Then
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
Forms![Product]![InvoiceID] = Invoice
Else
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
End If
Exit_Command80_Click:
Exit Sub
Err_Command80_Click:
MsgBox Err.Description
Resume Exit_Command80_Click

End Sub

Thanks
John
Nov 12 '05 #1
2 2270
On 11 May 2004 04:09:54 -0700, jn**********@yahoo.com (John) wrote:

On what line are you getting that error? Perhaps InvoiceID can be >
32767, in which case an Integer is not good enough. Change to:
Dim Invoice as Long

-Tom.

Hi All,
I get the overflow error message when I clicked in a button, but so
far I can't see anything wrong with the code below. Can anybody help?
I'm still a newbie with Access. Any help will be appreciated.

Private Sub Command63_Click()
On Error GoTo Err_Command80_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim Invoice As Integer

Invoice = Me![InvoiceID]
If IsNull(DLookup("[invoiceid]", "[Product]", "[invoiceid]=" &
Invoice)) Then
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
Forms![Product]![InvoiceID] = Invoice
Else
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
End If
Exit_Command80_Click:
Exit Sub
Err_Command80_Click:
MsgBox Err.Description
Resume Exit_Command80_Click

End Sub

Thanks
John


Nov 12 '05 #2
Hi Tom,
Thanks for your help, I really appreciated. I changed the Invoice to
Long and it worked fine.
Thank You
John Smith
Tom van Stiphout <to*****@no.spam.cox.net> wrote in message news:<kh********************************@4ax.com>. ..
On 11 May 2004 04:09:54 -0700, jn**********@yahoo.com (John) wrote:

On what line are you getting that error? Perhaps InvoiceID can be >
32767, in which case an Integer is not good enough. Change to:
Dim Invoice as Long

-Tom.

Hi All,
I get the overflow error message when I clicked in a button, but so
far I can't see anything wrong with the code below. Can anybody help?
I'm still a newbie with Access. Any help will be appreciated.

Private Sub Command63_Click()
On Error GoTo Err_Command80_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim Invoice As Integer

Invoice = Me![InvoiceID]
If IsNull(DLookup("[invoiceid]", "[Product]", "[invoiceid]=" &
Invoice)) Then
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
Forms![Product]![InvoiceID] = Invoice
Else
stDocName = "Product Details"
DoCmd.OpenForm stDocName, , , "[InvoiceID]= " & Me![InvoiceID]
End If
Exit_Command80_Click:
Exit Sub
Err_Command80_Click:
MsgBox Err.Description
Resume Exit_Command80_Click

End Sub

Thanks
John

Nov 12 '05 #3

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

Similar topics

3
by: ip4ram | last post by:
I am quite puzzled by the stack overflow which I am encountering.Here is the pseudocode //define stack structure //function operating on stack void my_stack_function( function parameters) {...
19
by: Jim | last post by:
I have spent the past few weeks designing a database for my company. The problem is I have started running into what I believe are stack overflow problems. There are two tab controls on the form...
7
by: MLH | last post by:
?2944*24 gives me an overflow error, entered in the immediate window. Anybody else?
4
by: Chua Wen Ching | last post by:
Thanks Derek... Okay i had another question.. my program runs smoothly for the first minute, after 1 minute... suddenly it breaks and display this error: do you know what is the cause of...
4
by: glenn | last post by:
I have a COM Server I've written in C#. I have a client app I've written in Delphi that is calling the C# COM Server. However, one of the functions in the COM Server creates a form and during the...
4
by: Tom | last post by:
I have a VB.NET framework 1.1 application that I am installing on my user's workstation. It works fine on EVERY machine except for one - on this one machine it generates a 'Overflow or underflow in...
25
by: junky_fellow | last post by:
Is there any way by which the overflow during addition of two integers may be detected ? eg. suppose we have three unsigned integers, a ,b, c. we are doing a check like if ((a +b) > c) do...
8
by: starffly | last post by:
In my program, the caculated value is supposed to be no more than the constant named MAXINT,otherwise, overflow error will be informed.however, I cannot test if the value exceeds MAXINT within the...
10
by: Parachute | last post by:
Using Borland Builder 6, I get numerical overflow when running a small programme without CodeGuard ("exp: OVERFLOW error"). The programme does not give any error messages when CodeGuard is...
3
by: MLH | last post by:
A wide comma delimited text file import into A97 failed with an overflow error. I'm estimating it to have been no more than 1000 records. 100% of all the fields were quoted strings or ZLS's. ...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
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
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...

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.