我收到运行时错误6'溢出'在到达以' minimo'开头的行时,对以下代码发送消息。直到最近才工作正常。在为其基础表单提供一些化妆品类型更新后,此消息已到达,我无法理解原因。
'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)
答案 0 :(得分:3)
尝试在程序开头插入以下行:
Dim minimo as Long