1.请购作业程序
PrivateSubComCX_Click()’查询
'在\编号\文本框中输入编号,连接数据库,查询编号,并将\编号\品名\规格\单位\单价\的数据分别导入到相应文本框。
SetCN=NewADODB.Connection
SetRs=NewADODB.Recordset
istSecurityInfo=False\
'打开数据库
Rs.CursorType=adOpenStatic'制定一个静态游标
Rs.LockType=adLockOptimistic'设置锁定模式为开放式
Rs.Open\
DoEvents
DoUntilRs.EOF=True
IfRs.EOF=FalseThen
listBHSJ1.AddItem(Rs.Fields(0))
listPMSJ1.AddItem(Rs.Fields(1))
listGGSJ1.AddItem(Rs.Fields(2))
listDWSJ1.AddItem(Rs.Fields(3))
listDJSJ1.AddItem(Rs.Fields(4))
Rs.MoveNext
EndIf
Loop
EndSub
PrivateSubcomFHZY_Click()’返回上页
frmQGZY.Hide
frmCKGLXT.Show
EndSub
PrivateSubcomQD_Click()’录入数据
IftextBHSJ.Text=\DJSJ.Text=\
MsgBox\请将数据补充完整!\
textBHSJ.Text=\
textPMSJ.Text=\
textGGSJ.Text=\
textDWSJ.Text=\
textDJSJ.Text=\
textQGSLSJ.Text=\
Else
DimcnnAsNewConnection,rstAsNewRecordset,fidAsField
DimstrSqlAsString,strconnAsString
strSql=\
strconn=strconn&\设计专用\\仓库数据资料\\仓库数据资料.mdb'\
cnn.ConnectionString=strconn
cnn.Open
Setrst=cnn.Execute(strSql)
str1=\
str1=str1+\textGGSJ.Text)&\textQGSLSJ.Text)&\
cnn.Executestr1
listBHSJ1.AddItem(Trim(textBHSJ.Text))
listPMSJ1.AddItem(Trim(textPMSJ.Text))
listGGSJ1.AddItem(Trim(textGGSJ.Text))
listDWSJ1.AddItem(Trim(textDWSJ.Text))
listDJSJ1.AddItem(Trim(textDJSJ.Text))
listQGSLSJ1.AddItem(Trim(textQGSLSJ.Text))
MsgBox\数据输入成功!\
rst.Close
cnn.Close
SetRs=Nothing
SetCN=Nothing
textBHSJ.Text=\
textPMSJ.Text=\
textGGSJ.Text=\
textDWSJ.Text=\
textDJSJ.Text=\
textQGSLSJ.Text=\
EndIf
EndSub
PrivateSubcomsc_Click()’删除
IflistBHSJ1.SelCount>0Then
Fori=listBHSJ1.ListCount-1To0Step-1
IflistBHSJ1.Selected(i)Then
textBHSJ.Text=listBHSJ1.List(i)
textPMSJ.Text=listPMSJ1.List(i)
textGGSJ.Text=listGGSJ1.List(i)
textDWSJ.Text=listDWSJ1.List(i)
textDJSJ.Text=listDJSJ1.List(i)
textQGSLSJ.Text=listQGSLSJ1.List(i)
EndIf
Next