在到達以'minimo'開頭的行時,下面的代碼中出現運行時錯誤6'溢出'消息。直到最近它一直工作正常。在爲其底層表單提供了一些整型更新之後,這條消息已經到達,我不明白爲什麼。運行時錯誤6溢出
'Dim rs As 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)
如何* * MINIMO聲明?如果它是Integer,它不能接受大於32,767的值。當你遇到這個錯誤時,rs.Fields(0)的值是多少? – HansUp 2015-01-20 19:14:34