主题:在对应的集合中,未找到项目,各位帮帮忙阿
Set rs1 = New ADODB.Recordset
rs1.CursorLocation = adUseClient
Set rs1 = cn.Execute("select * from 原材料价格表")
Set rs2 = New ADODB.Recordset
rs2.CursorLocation = adUseClient
Set rs2 = cn.Execute("select * from 原材料消耗表 where 型号='" & Combo1.Text & "' and 规格='" & Combo2.Text & "'")
If Not rs2.EOF Then
Do While Not rs1.EOF
str = rs1.Fields("原材料名称")
[color=FF0000] If rs2.Fields(str) <> 0 And rs2.Fields(str) <> "" Then[/color]
List2.AddItem rs1.Fields("原材料名称")
Else
List1.AddItem rs1.Fields("原材料名称")
End If
rs1.MoveNext
Loop
End If
红字部分出现错误。 在对应的集合中,未找到项目,各位帮帮忙阿
rs1.CursorLocation = adUseClient
Set rs1 = cn.Execute("select * from 原材料价格表")
Set rs2 = New ADODB.Recordset
rs2.CursorLocation = adUseClient
Set rs2 = cn.Execute("select * from 原材料消耗表 where 型号='" & Combo1.Text & "' and 规格='" & Combo2.Text & "'")
If Not rs2.EOF Then
Do While Not rs1.EOF
str = rs1.Fields("原材料名称")
[color=FF0000] If rs2.Fields(str) <> 0 And rs2.Fields(str) <> "" Then[/color]
List2.AddItem rs1.Fields("原材料名称")
Else
List1.AddItem rs1.Fields("原材料名称")
End If
rs1.MoveNext
Loop
End If
红字部分出现错误。 在对应的集合中,未找到项目,各位帮帮忙阿