473,396 Members | 1,914 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,396 software developers and data experts.

Access Run Time Error 6 Overflow

I have been using the code below successfully for almost a year.
yesterday, I began getting a run time error 6 (overflow). I am using
the code in an Access 2000 database. Can anyone help me understand
what I can do to correct this?

The error points to the "MaxKey = DLookup("Expr1", "lkqry_Histry_Max#")
+ 1" as the breakpoint.

thanks,

Christy

Option Compare Database
Option Explicit

Private Sub Command11_Click()
Dim MaxKey As Integer

Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_History", dbOpenDynaset)

MaxKey = DLookup("Expr1", "lkqry_Histry_Max#") + 1

'Added by Christy Clifton, modified 2/12/05 to pop up message reminding
associate to select a
'request type

If IsNull(Me.Text0) Then
strMsg = "Please Enter Note."
MsgBox strMsg, , "SWAT: Run-Time Error"
ElseIf IsNull(Me.Combo8) Then
strMsg = "Please Select A Status."
MsgBox strMsg, , "SWAT: Run-Time Error"
ElseIf IsNull(Me.Combo19) Then
strMsg = "Please Select An Activity Code."
MsgBox strMsg, , "SWAT: Run-Time Error"
'If Me.Combo8 = S3 Or S5 Then
' strMsg = "Please Make Sure You Have Entered A Request
Type."
' MsgBox strMsg, , "SWAT: REMINDER"
'ElseIf Me.Combo8 = "S3" Then
'strMsg = "Please Make Sure You Have Entered A Request
Type."
'MsgBox strMsg, , "SWAT: REMINDER"
'ElseIf Me.Combo8 = "S5" Then
'strMsg = "Please Make Sure You Have Entered A Request
Type."
'MsgBox strMsg, , "SWAT: REMINDER"

Else
rst.AddNew
rst!Auto_Key = MaxKey
rst!App_ID = Me.Text2
rst!Update_Date = Format(Now(), "mm/dd/yyyy")
rst!Status = Me.Combo8
rst!Notes = Me.Text0
rst!User = Forms!frm_Main_Menu!CrtUser
rst!Time = Time
'rst!Resolve_Reason = Me.ResolveReason
rst!Act_Code = Me.Combo19
rst.Update
db.Execute "update tbl_EMAIL_Data set status='" & Me.Combo8 &
"' where app_id='" & Me.Text2 & "'"
db.Execute "update tbl_EMAIL_Data set Last_Updated='" &
Format(Now(), "mm/dd/yyyy") & "' where app_id='" & Me.Text2 & "'"

If CurrentProject.AllForms("frm_EditRecord").IsLoaded = True Then
Forms!frm_EditRecord!Notes.Requery
DoCmd.Close
End If

End Sub

Private Sub Command12_Click()
DoCmd.Close
End Sub

Nov 13 '05 #1
4 20765
You have MaxKey declared as an INTEGER. Change it to LONG

--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast/

"Christaaay" <ch*************@capitaloneauto.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have been using the code below successfully for almost a year.
yesterday, I began getting a run time error 6 (overflow). I am using
the code in an Access 2000 database. Can anyone help me understand
what I can do to correct this?

The error points to the "MaxKey = DLookup("Expr1", "lkqry_Histry_Max#")
+ 1" as the breakpoint.

thanks,

Christy

Option Compare Database
Option Explicit

Private Sub Command11_Click()
Dim MaxKey As Integer

Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_History", dbOpenDynaset)

MaxKey = DLookup("Expr1", "lkqry_Histry_Max#") + 1

'Added by Christy Clifton, modified 2/12/05 to pop up message reminding
associate to select a
'request type

If IsNull(Me.Text0) Then
strMsg = "Please Enter Note."
MsgBox strMsg, , "SWAT: Run-Time Error"
ElseIf IsNull(Me.Combo8) Then
strMsg = "Please Select A Status."
MsgBox strMsg, , "SWAT: Run-Time Error"
ElseIf IsNull(Me.Combo19) Then
strMsg = "Please Select An Activity Code."
MsgBox strMsg, , "SWAT: Run-Time Error"
'If Me.Combo8 = S3 Or S5 Then
' strMsg = "Please Make Sure You Have Entered A Request
Type."
' MsgBox strMsg, , "SWAT: REMINDER"
'ElseIf Me.Combo8 = "S3" Then
'strMsg = "Please Make Sure You Have Entered A Request
Type."
'MsgBox strMsg, , "SWAT: REMINDER"
'ElseIf Me.Combo8 = "S5" Then
'strMsg = "Please Make Sure You Have Entered A Request
Type."
'MsgBox strMsg, , "SWAT: REMINDER"

Else
rst.AddNew
rst!Auto_Key = MaxKey
rst!App_ID = Me.Text2
rst!Update_Date = Format(Now(), "mm/dd/yyyy")
rst!Status = Me.Combo8
rst!Notes = Me.Text0
rst!User = Forms!frm_Main_Menu!CrtUser
rst!Time = Time
'rst!Resolve_Reason = Me.ResolveReason
rst!Act_Code = Me.Combo19
rst.Update
db.Execute "update tbl_EMAIL_Data set status='" & Me.Combo8 &
"' where app_id='" & Me.Text2 & "'"
db.Execute "update tbl_EMAIL_Data set Last_Updated='" &
Format(Now(), "mm/dd/yyyy") & "' where app_id='" & Me.Text2 & "'"

If CurrentProject.AllForms("frm_EditRecord").IsLoaded = True Then
Forms!frm_EditRecord!Notes.Requery
DoCmd.Close
End If

End Sub

Private Sub Command12_Click()
DoCmd.Close
End Sub

Nov 13 '05 #2
just LONG or LONGINTEGER?

Nov 13 '05 #3
I think the syntax is Long, but it does stand for Long Integer.
If you have been using this code for some time, you may have
exceeded the 32000 (yeah, that's not exact) limit for integers
and simply need the variable to match the table field data type.

--

Danny J. Lesandrini
dl*********@hotmail.com
http://amazecreations.com/datafast/

"Christaaay" <ch*************@capitaloneauto.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
just LONG or LONGINTEGER?

Nov 13 '05 #4
Redefine MaxKey as a long, I would guess you've exceeded the maximum value
for an integer.

--
Terry Kreft

"Christaaay" <ch*************@capitaloneauto.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have been using the code below successfully for almost a year.
yesterday, I began getting a run time error 6 (overflow). I am using
the code in an Access 2000 database. Can anyone help me understand
what I can do to correct this?

The error points to the "MaxKey = DLookup("Expr1", "lkqry_Histry_Max#")
+ 1" as the breakpoint.

thanks,

Christy

Option Compare Database
Option Explicit

Private Sub Command11_Click()
Dim MaxKey As Integer

Set db = CurrentDb
Set rst = db.OpenRecordset("tbl_History", dbOpenDynaset)

MaxKey = DLookup("Expr1", "lkqry_Histry_Max#") + 1

'Added by Christy Clifton, modified 2/12/05 to pop up message reminding
associate to select a
'request type

If IsNull(Me.Text0) Then
strMsg = "Please Enter Note."
MsgBox strMsg, , "SWAT: Run-Time Error"
ElseIf IsNull(Me.Combo8) Then
strMsg = "Please Select A Status."
MsgBox strMsg, , "SWAT: Run-Time Error"
ElseIf IsNull(Me.Combo19) Then
strMsg = "Please Select An Activity Code."
MsgBox strMsg, , "SWAT: Run-Time Error"
'If Me.Combo8 = S3 Or S5 Then
' strMsg = "Please Make Sure You Have Entered A Request
Type."
' MsgBox strMsg, , "SWAT: REMINDER"
'ElseIf Me.Combo8 = "S3" Then
'strMsg = "Please Make Sure You Have Entered A Request
Type."
'MsgBox strMsg, , "SWAT: REMINDER"
'ElseIf Me.Combo8 = "S5" Then
'strMsg = "Please Make Sure You Have Entered A Request
Type."
'MsgBox strMsg, , "SWAT: REMINDER"

Else
rst.AddNew
rst!Auto_Key = MaxKey
rst!App_ID = Me.Text2
rst!Update_Date = Format(Now(), "mm/dd/yyyy")
rst!Status = Me.Combo8
rst!Notes = Me.Text0
rst!User = Forms!frm_Main_Menu!CrtUser
rst!Time = Time
'rst!Resolve_Reason = Me.ResolveReason
rst!Act_Code = Me.Combo19
rst.Update
db.Execute "update tbl_EMAIL_Data set status='" & Me.Combo8 &
"' where app_id='" & Me.Text2 & "'"
db.Execute "update tbl_EMAIL_Data set Last_Updated='" &
Format(Now(), "mm/dd/yyyy") & "' where app_id='" & Me.Text2 & "'"

If CurrentProject.AllForms("frm_EditRecord").IsLoaded = True Then
Forms!frm_EditRecord!Notes.Requery
DoCmd.Close
End If

End Sub

Private Sub Command12_Click()
DoCmd.Close
End Sub

Nov 20 '05 #5

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

Similar topics

5
by: NB | last post by:
Hi In my 2 years with Access I have never seen this, now it makes me mad In an unbound form frmTH I have a frmList which is a continous form In its on current event, I synch 4 of its fields...
0
by: crypto_solid via AccessMonster.com | last post by:
I have been using a SQL database with a VB5 frontend for about 5 years. Works well. Unfortunately I don't have access to the source code. I was tasked with implementing a "job entry" application...
3
by: C. Sengstock | last post by:
Hi, i´ve got an iteration with random generated floating point numbers. During the iteration process sometimes the programm stops with the error: "floating point error: overflow" Is the...
0
by: rc | last post by:
Moved a working MS Access application from Win2000 (version 5.0 SP 3) OS with MS Access 2000 and DB2 Run-time client v7.1 FP 4 to XP (version 5.1, SP 2) OS with MS Access 2003 and DB2 Run-time...
1
by: Steve Fraser | last post by:
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...
2
by: jr | last post by:
Hello everyone! I am new to this sort of postings so I'm not even sure if this is the correct place to start. Anyway, I would realy appreciate any help. I have a some VBA code that works quite...
0
by: krakesh11 | last post by:
Hi , In my sas program , I am facing a problem of overflow error in one of my SAS programs . Kindly help me in gettingresolve this issue . The exact error message which I got is : "ERROR:...
0
by: 362315 | last post by:
I am receiving the following error: Microsoft Visual Basic Run-Time error '2147467259 (80004005)': The microsoft jet database engine cannot open the file. It is already opened exclusively by...
1
by: Amy Badgett | last post by:
I keep getting the error: "Overflow" with this piece of MS Access SQL coding: SELECT DISTINCT (SELECT Count(tblCallLog.tblCallLog_gospelPresented) FROM tblCallLog WHERE...
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
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
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
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.