ArticleStye这个栏位的值保存不到数据库table里
问题点:ArticleStye这个栏位的值保存不到数据库table里,请求帮助!做一个送货类别的栏位,我使用了listbox,代码如下:
Private Sub lstArticleStye_Click()
lstArticleStye.AddItem "送货"
lstArticleStye.AddItem "出货"
lstArticleStye.AddItem "送货&带货"
End Sub
保存到数据库的代码:
Private Sub Save_Data()
Dim mTYPE As String, mEDIT As String
mTYPE = "W"
W_NO = Txh_SNO.Text
'txtSQL = "select * from articlebring where SNO='" & W_NO & "'"
'If mrc.EOF Then
If W_NO = "" Then
W_NO = mTYPE + Format(Date, "YYYYMMDD") + GET_WNO(mTYPE)
Txh_SNO.Text = W_NO
End If
'End If
txtSQL = "select * from articlebring where SNO='" & W_NO & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText)
If mrc.EOF Then
mrc.AddNew
mrc.Fields("SNO").value = W_NO
mrc.Fields("workflow_id1").value = Combo2
mrc.Fields("workflow_id2").value = Combo3
mrc.Fields("workflow_id3").value = Combo4
mrc.Fields("sys_user") = UserName
mrc.Fields("sys_ymd") = Format(Date, "YYYY-MM-DD")
mrc.Fields("sys_time") = Format(Time, "HH:MM:SS")
Else
mrc.Fields("workflow_id1").value = Combo2
mrc.Fields("workflow_id2").value = Combo3
mrc.Fields("workflow_id3").value = Combo4
mrc.Fields("sys_luser") = UserName
mrc.Fields("sys_lymd") = Format(Date, "YYYY-MM-DD")
mrc.Fields("sys_ltime") = Format(Time, "HH:MM:SS")
End If
mrc.Fields("Reg_no").value = txhReg_no.Text
mrc.Fields("Part_Name").value = Texhpart_name.Text
'mrc.Fields("Size").value = Texhsize.Text
mrc.Fields("Date").value = Format(dtpDate.value, "YYYY-MM-DD")
mrc.Fields("BringName").value = txtBringName.Text
mrc.Fields("Station").value = txtStation.Text
mrc.Fields("ArticleStye").value = lstArticleStye.Text
mrc.Fields("GetName").value = txtGetName.Text
mrc.Fields("Tel").value = txtTel.Text
mrc.Fields("bring_Time").value = Format(DTPicker1(1).value, "YYYY-MM-DD") & " " & Format(DTPicker2(1).value, "HH:MM:SS")
'mrc.Fields("part_Num").value = Texpart_Num.Text
mrc.Fields("Emp_Depart").value = Texhemp_depart.Text
mrc.Fields("Return_Time").value = Format(DTPicker1(0).value, "YYYY-MM-DD") & " " & Format(DTPicker2(0).value, "HH:MM:SS")
mrc.Fields("bring_comp").value = Texbring_comp.Text
mrc.Fields("guard_id").value = txtGuard_id.Text
mrc.Fields("workflow_id1").value = Combo2.Text
mrc.Fields("workflow_id2").value = Combo3.Text
mrc.Fields("workflow_id3").value = Combo4.Text
'mrc.Fields("workflow_sure1").value = ""
'mrc.Fields("workflow_sure2").value = ""
'mrc.Fields("workflow_sure3").value = ""
mrc.Update
mrc.Close
End Sub --------------------编程问答-------------------- LockType = adLockOptimistic --------------------编程问答--------------------
不好意思,没看懂什么意思,我一菜鸟,呵呵,能麻烦详细指点吗?
补充:VB , 控件