首页上一页 1 下一页尾页 1 条记录 1/1页
出错
发表在VB答疑区
2008-08-27
是否精华
是
否
版块置顶:
是
否
请帮忙看下代码,执行时出错提示"bof或eof中有一个是真..........."
Private Sub Com_js_Click()
Dim rsgz As New ADODB.Recordset
Dim rsgzgd As New ADODB.Recordset
Dim yfxj, sfje As Single
Dim c As Integer
c = MsgBox("请确认所有数据无误!继续吗?", 17, "警告")
If c = 1 Then
rsgz.Open "select * from gz where 日期='" & Text2 & "'and 部门='" & Combo2.Text & "'", AdoCon, adOpenStatic, adLockOptimistic
rsgzgd.Open "select * from gzgd where 工号=" & rsgz.Fields("工号"), AdoCon, adOpenStatic, adLockOptimistic
rsgz.MoveFirst
If rsgz.RecordCount > 0 Then
Do Until rsgz.EOF
With rsgz
yfxj = .Fields("正班天数") * rsgzgd.Fields("底薪") + .Fields("平时加班") * (rsgzgd.Fields("底薪") / 8) * 1.5 + .Fields("假日加班") * (rsgzgd.Fields("底薪") / 8) * 2 + rsgzgd.Fields("加项1") + rsgzgd.Fields("加项2") + .Fields("加项3") + .Fields("加项4") + .Fields("补贴") + .Fields("奖金")
sfje = yfxj - ((.Fields("迟到扣款时间") / 60) * (rsgzgd.Fields("底薪") / 8) + .Fields("其它扣款时间") * (rsgzgd.Fields("底薪") / 8)) - (rsgzgd.Fields("社保") + rsgzgd.Fields("减项1") + rsgzgd.Fields("减项2") + .Fields("减项3") + .Fields("减项4") + .Fields("减项5") + .Fields("减项6"))
End With
AdoCon.Execute ("update gz set 应发小计=" & yfxj & ",实发金额=" & sfje)
rsgz.MoveNext
Loop
Else
MsgBox "未有资料,请确定查找条件", , "提示"
End If
End If
rsgz.Close
rsgzgd.Close
End Sub
Private Sub Com_js_Click()
Dim rsgz As New ADODB.Recordset
Dim rsgzgd As New ADODB.Recordset
Dim yfxj, sfje As Single
Dim c As Integer
c = MsgBox("请确认所有数据无误!继续吗?", 17, "警告")
If c = 1 Then
rsgz.Open "select * from gz where 日期='" & Text2 & "'and 部门='" & Combo2.Text & "'", AdoCon, adOpenStatic, adLockOptimistic
rsgzgd.Open "select * from gzgd where 工号=" & rsgz.Fields("工号"), AdoCon, adOpenStatic, adLockOptimistic
rsgz.MoveFirst
If rsgz.RecordCount > 0 Then
Do Until rsgz.EOF
With rsgz
yfxj = .Fields("正班天数") * rsgzgd.Fields("底薪") + .Fields("平时加班") * (rsgzgd.Fields("底薪") / 8) * 1.5 + .Fields("假日加班") * (rsgzgd.Fields("底薪") / 8) * 2 + rsgzgd.Fields("加项1") + rsgzgd.Fields("加项2") + .Fields("加项3") + .Fields("加项4") + .Fields("补贴") + .Fields("奖金")
sfje = yfxj - ((.Fields("迟到扣款时间") / 60) * (rsgzgd.Fields("底薪") / 8) + .Fields("其它扣款时间") * (rsgzgd.Fields("底薪") / 8)) - (rsgzgd.Fields("社保") + rsgzgd.Fields("减项1") + rsgzgd.Fields("减项2") + .Fields("减项3") + .Fields("减项4") + .Fields("减项5") + .Fields("减项6"))
End With
AdoCon.Execute ("update gz set 应发小计=" & yfxj & ",实发金额=" & sfje)
rsgz.MoveNext
Loop
Else
MsgBox "未有资料,请确定查找条件", , "提示"
End If
End If
rsgz.Close
rsgzgd.Close
End Sub