Office中国论坛/Access中国论坛
标题:
运行一半会出现溢出提示 80040e21
[打印本页]
作者:
taogon
时间:
2007-1-25 23:03
标题:
运行一半会出现溢出提示 80040e21
请高手帮忙看一下
Dim str, str1, str2 As String
Dim rs, rs1 As ADODB.Recordset
Set rs = New ADODB.Recordset
Set rs1 = New ADODB.Recordset
str = "select * from 工资总表 where 工号"
str1 = "select * from 奖励系数"
rs.Open str, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
rs1.Open str1, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
Do Until rs.EOF
If rs("总出勤") = 0 Or rs("总工分") = 0 Or IsNull(rs("公司类别")) Or rs("级别分") = 0 Then
rs("奖励系数") = 0
Else
Do Until rs1.EOF
If rs("公司类别") = rs1("公司类别") Then
If rs("出勤类别") = "一类正常" And rs("总工分") >= rs1("开始") And rs("总工分") < rs1("结束") Then
rs("奖励系数") = rs1("调整系数")
GoTo tingzhi
End If
If rs("出勤类别") = "一类特殊" And rs("总工分") / rs("总出勤") * 345 >= rs1("开始") And rs("总工分") / rs("总出勤") * 345 < rs1("结束") Then
rs("奖励系数") = rs1("调整系数")
GoTo tingzhi
End If
End If
rs1.MoveNext
Loop
End If
tingzhi:
rs1.MoveFirst
rs.MoveNext
Loop
记录大概有15000条,如果分两段计算可以通过,不过放在一起就不可以了,请高手指点
作者:
fan0217
时间:
2007-1-26 02:00
贴出例子来,方便大家调试!
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3