|
请各位大侠帮帮忙,
用循环语句读取列表框内的值,与表字段值比较,相符并改变另一字段值,出现错误:无当前记录?
Private Sub Command3_Click()
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("SELECT 订单明细.订单ID, 订单明细.列印 FROM 订单明细")
Dim I As Integer
Dim J As Integer
Dim S As Variant
rs.MoveLast
rs.MoveFirst
MsgBox rs.RecordCount
For I = 0 To Me.List0.ListCount - 1
S = Me.List0.ItemData(I)
For J = 0 To rs.RecordCount - 1
If rs.Fields("订单ID").Value = S Then '错误:无当前记录
rs.Edit
rs.Fields(1).Value = True
rs.Update
End If
rs.MoveNext
Next J
Next I
End Sub
[ 本帖最后由 fnsmydyang 于 2008-8-29 22:15 编辑 ] |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|