If ckcp.Value Then
sql = "select * from 成品档案 where 炉号 ='" + Trim(Text6.Text) + "'"
If sql <> "" Then
cnn.Execute "update 成品档案 set 发货否='" + Trim(Text7.Text) + "'from " & sql
MsgBox "记录添加成功!", , "成品管理系统"
Adodc2.Refresh
End If
End If
...全文
763打赏收藏
请教批量入库的问题
我想将炉号为Text7.Text的数据成品档案的发货否更改为是以下代码怎么改才合适 If ckcp.Value Then sql = "select * from 成品档案 where 炉号 ='" + Trim(Text6.Text) + "'" If sql "" Then cnn.Execute "update 成品档案 set 发货否='" + Trim(Text7.Text) + "'from " & sql MsgBox "记录添加成功!", , "成品管理系统" Adodc2
还是不行,下面我的这段代码想批量入库炉批号为text8,
喷标号在text6和text7之间的记录中的发货否(字段号为13)更改为"是"
If ckcp.Value Then
Dim se As New ADODB.Recordset
se.Open "select * from 成品档案 where 炉批号='" + Trim(Text8.Text) + "'and 喷标号 between '" & Trim(Text6.Text) & "' and '" & Trim(Text7.Text) & "'", cnn, adOpenKeyset, adLockOptimistic
se.Fields(13) = "是"
se.Update
MsgBox "记录添加成功!", , "成品管理系统"
End If
可是只能更改第一个记录集
[Quote=引用 1 楼 leftie 的回复:]
VB code
If ckcp.Value Then
sql=" update 成品档案 set 发货否='"& trim(text7.text) &"' where 炉号='"& trim(text6.text &"'"
cnn.Execute sql
MsgBox "记录添加成功!", , "成品管理系统"
End If
[/Quote]
If ckcp.Value Then
sql=" update 成品档案 set 发货否='"& trim(text7.text) &"' where 炉号='"& trim(text6.text &"'"
cnn.Execute sql
MsgBox "记录添加成功!", , "成品管理系统"
End If