Microsoft Access Vba Overflow Error
Contents |
be down. Please try the request again. Your cache administrator is webmaster. Generated Thu, 20 Oct 2016 11:54:43 GMT by s_nt6 (squid/3.5.20)
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this runtime error 6 overflow windows 7 site About Us Learn more about Stack Overflow the company Business Learn more excel vba overflow error 6 about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x
Vba Overflow Integer
Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up MS Access http://answers.microsoft.com/en-us/msoffice/forum/msoffice_access-mso_other/access-2003-overflow-error/bb9e4c66-661c-4de3-990f-15112836c77a Overflow Error up vote 1 down vote favorite I am getting an Overflow error in Access when this line runs intAT = Nz(DLookup("at_ID", "qryAT", "at_sc_ID=" & Me.sc_ID & " AND at_OT=0"), 0) If I add Debug.Print Nz(DLookup("at_ID", "qryAT", "at_sc_ID=" & Me.sc_ID & " AND at_OT=0"), 0) just before that line, it prints the id number just fine, but still errors during the assignment on http://stackoverflow.com/questions/19099354/ms-access-overflow-error the next line. I can also get it to work by adding a criterion to the query that limits all the results to those that occur before a certain day and time. It ONLY works limiting the query to before that particular time, not after an earlier time. If any of the records after that time are included, it overflows again. I have looked at the data that was entered after that time and it all seems fine, but I am not sure what exactly I should be looking for. The at_ID associated with the first record that causes it to fail is 32838 if that helps at all. vba ms-access access-vba share|improve this question edited Sep 30 '13 at 16:45 HansUp 79.3k114371 asked Sep 30 '13 at 16:36 philthyfool 74312 convert intAT to double. –Santosh Sep 30 '13 at 16:38 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted My guess is that intAT was declared as Integer type. But 32,838 is too large for an Integer. (Integer can hold numbers from –32,768 to 32,767) So it triggers error #6, "Overflo
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and http://stackoverflow.com/questions/28053343/runtime-error-6-overflow policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a error 6 minute: Sign up runtime error 6 overflow up vote 2 down vote favorite I am getting a Runtime error 6 'overflow' message on the following code upon arriving at the line starting with 'minimo'. It was working fine until recently. After providing some cosmetic-type updates to its underlying form this message has arrived and I can't understand why. 'Dim rs As runtime error 6 ADODB.Recordset Set rs = New ADODB.Recordset rs.Open "select min(autonumerazione) from tblDashboard01", CurrentProject.Connection Do While Not rs.EOF minimo = rs.Fields(0) rs.MoveNext Loop minimo = minimo - 1 st_Sql = "update tbldashboard01 set MasterLevel = autonumerazione - " & minimo & "" Application.DoCmd.RunSQL (st_Sql) access-vba ms-access-2010 share|improve this question edited Jan 20 '15 at 19:16 HansUp 79.3k114371 asked Jan 20 '15 at 19:11 Marchese Il Chihuahua 4601826 How is minimo declared? If it's Integer, it can't accept a value larger than 32,767. What is the value of rs.Fields(0) when you hit that error? –HansUp Jan 20 '15 at 19:14 add a comment| 1 Answer 1 active oldest votes up vote 3 down vote accepted Try inserting the following line at the start of the program: Dim minimo as Long share|improve this answer answered Jan 20 '15 at 19:23 miroxlav 5,66121744 bravo. Thank you –Marchese Il Chihuahua Jan 20 '15 at 19:39 3 @MarcheseIlChihuahua – My practice is to insert Option Explicit as the first line of every program module (file). This forces me to declare every variable using Dim statement