类型不匹配问题
ACCESS中表更新的问题,代码如下:
For Index = 0 To 2
txtsql = "select * from 库存表 where 材料编号='" & 材料编号(Index) & "'"
Set rst = exesql(txtsql)
If rst.RecordCount > 0 Then
rst.Fields(1) = rst.Fields(1).Value + 数量(Index).Text VB提示出错的语句
rst.Update
rst.Requery
Else
txtsql = "select * from 库存表 "
Set rst = exesql(txtsql)
rst.AddNew
rst.Fields(0) = 材料编号(Index)
rst.Fields(1) = 数量(Index).Text
rst.Update
rst.Requery
End If
Next Index
提示类型不匹配, 材料编号在库存表是主键