请帮忙!以下代码,有错误在哪?本人查不出来
此主题相关图片如下:错误提示1.bmp
Dim cmd As New SQLCommand
cmd.C
with e.form
if .Controls("ComboBox5").Value is nothing then
MsgBox("请选择货主代码!",64,"提示")
.Controls("ComboBox5").Select()
'把记录写入表
else
dim tb as table = tables("查询表.出入库明细表")
For j as integer = 0 to tb.rows.count - 1
tb.rows(j)("入库单号") = .Controls("TextBox2").value
tb.rows(j)("进货车船号") = .Controls("TextBox7").value
tb.rows(j)("进货日期") = .Controls("datetimepicker1").value
tb.rows(j)("货主名称") = .Controls("TextBox25").value
tb.rows(j)("状态") = .Controls("TextBox5").value
tb.rows(j)("进货车船号") = .Controls("TextBox7").value
Next
DataTables("出入库明细表").Save()
dim i as integer
dim kz as string = "TextBox14,ComboBox4,TextBox2,TextBox6,TextBox11,TextBox12,TextBox10,TextBox3,ComboBox5,TextBox25"
dim sql as string = "Insert Into [出入库] (出入库,日期,类型,单号,仓库名称,实入量,实入件数,卸货码头,操作者,货主代号,货主名称) "
sql = sql & " Values ('入库','@$0','@$1','@$2','@$3','@$4','@$5','@$6','@$7'','@$8','@$9')"
For Each k as string In kz.split(",")
sql = sql.Replace("@$" & i,.Controls(k).Value)
i += 1
Next
cmd.CommandText = sql
cmd.ExecuteNonQuery()
'移除关联表为空表
DataTables("出入库明细表").LoadFilter = "[关联] = ''"
DataTables("出入库明细表").Load()
'判断是否重新添加记录,设置控件为空
For Each k as string In kz.split(",")
.Controls(k).Value = ""
Next
end if
end with