Set rstwo = CurrentDb.OpenRecordset("SELECT* FROM 产品版本号关系表 WHERE 产品版本号关系表.产品号=[Forms]![bom]![Text57] and 产品版本号关系表.产品版本号=[Forms]![bom]![Text60] ", , dbReadOnly)
Set rstwo = CurrentDb.OpenRecordset("SELECT* FROM 产品版本号关系表 WHERE 产品版本号关系表.产品号=" & [Forms]![bom]![Text57] & " and 产品版本号关系表.产品版本号=" & [Forms]![bom]![Text60] , , dbReadOnly)
复制代码
如果是文本型,则:
Set rstwo = CurrentDb.OpenRecordset("SELECT* FROM 产品版本号关系表 WHERE 产品版本号关系表.产品号='" & [Forms]![bom]![Text57] & "' and 产品版本号关系表.产品版本号='" & [Forms]![bom]![Text60] & "'", , dbReadOnly)
While rsthree.EOF
While rstwo.EOF
If rsthree("零件号") = rstwo("零件号") Then
rstwo("零件图纸版本号") = rsthree("零件图纸版本号")
Else
End If
rstwo.MoveNext
Wend
rsthree.MoveNext
Wend
rstwo.Close
Set rstwo = Nothing
rsthree.Close
Set rsthree = Nothing
While rsthree.EOF
While rstwo.EOF
If rsthree("零件号") = rstwo("零件号") Then
rstwo("零件图纸版本号") = rsthree("零件图纸版本号")
Else
End If
rstwo.MoveNext
Wend
rsthree.MoveNext
Wend
rstwo.Close
Set rstwo = Nothing
rsthree.Close
Set rsthree = Nothing