VB仓库管理系统源代码

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

.

1.请购作业程序

Private Sub ComCX_Click()'查询

'在编号文本框中输入编号,连接数据库,查询编号,并将编号?品名?规格?单位?单价的数据分别导入到相应文本框。

Set CN = New ADODB.Connection

Set Rs = New ADODB.Recordset

CN.Open Provider=Microsoft.Jet.OLEDB.4.0;Data Source= & F:\VB设计专用\仓库数据资料\仓库数据资料.mdb;Persist Security Info=False

'打开数据库

Rs.CursorType = adOpenStatic '制定一个静态游标

Rs.LockType = adLockOptimistic '设置锁定模式为开放式

Rs.Open select * from JLBH where FtextBHSJ Like' & % & Trim(textBHSJ.Text)

& % & ', CN

DoEvents

Do Until Rs.EOF = True

If Rs.EOF = False Then

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))

专业资料Word

.

Rs.MoveNext

End If

Loop

End Sub

Private Sub comFHZY_Click()'返回上页

frmQGZY.Hide

frmCKGLXT.Show

End Sub

Private Sub comQD_Click()'录入数据

If textBHSJ.Text = \ Or textPMSJ.Text = \ Or textGGSJ.Text = \ Or textDWSJ.Text = \ Or textDJSJ.Text = \ Or textQGSLSJ.Text = \ Then

獍?硯尠请将数据补充完整!

textBHSJ.Text = \

textPMSJ.Text = \

textGGSJ.Text = \

textDWSJ.Text = \

textDJSJ.Text = \

textQGSLSJ.Text = \

Else

专业资料Word

.

Dim cnn As New Connection, rst As New Recordset, fid As Field

Dim strSql As String, strconn As String

strSql = Select textBHSJ From qgzy where textBHSJ= ' & Trim(textBHSJ.Text) & '

strconn = Provider=Microsoft.Jet.OLEDB.4.0;Data Source='

strconn = strconn & F:\VB设计专用\仓库数据资料\仓库数据资料.mdb'

cnn.ConnectionString = strconn

cnn.Open

Set rst = cnn.Execute(strSql)

str1

=

Insert

Into

qgzy

(textBHSJ,textPMSJ,textGGSJ,textDWSJ,textDJSJ,textQGSJ)

str1 = str1 + Values(' & Trim(textBHSJ.Text) & ',' & Trim(textPMSJ.Text) & ',' & Trim(textGGSJ.Text) & ',' & Trim(textDWSJ.Text) & ',' & Trim(textDJSJ.Text) & ',' & Trim(textQGSLSJ.Text) & ')

cnn.Execute str1

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))

专业资料Word

.

listQGSLSJ1.AddItem (Trim(textQGSLSJ.Text))

獍?硯尠数据输入成功!

rst.Close

cnn.Close

Set Rs = Nothing

Set CN = Nothing

textBHSJ.Text = \

textPMSJ.Text = \

textGGSJ.Text = \

textDWSJ.Text = \

textDJSJ.Text = \

textQGSLSJ.Text = \

End If

End Sub

Private Sub comsc_Click()'删除

If listBHSJ1.SelCount > 0 Then

For i = listBHSJ1.ListCount - 1 To 0 Step -1 If listBHSJ1.Selected(i) Then

专业资料Word

.

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) End If

Next

相关文档
最新文档