7.附录
一、库存物资系统部分代码:
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim connectionstring As String
connectionstring = "provider=Microsoft.Jet.oledb.4.0;" & _
"data source=data.mdb"
conn.Open connectionstring
cnt = 0
End Sub
Private Sub add_admin_Click()
tianjiayonghuming.Show
End Sub
Private Sub chang_Click()
kucun_chaxun.Show
End Sub
Private Sub del_Click()
kucun_shanchu.Show
End Sub
Private Sub edit_password_Click()
gengxinmima.Show
End Sub
Private Sub exit_Click()
End
End Sub
Private Sub g_report_Click()
DataReport1.Show
End Sub
Private Sub LAB_INDJ_Click()
ruku_dengji.Show
End Sub
Private Sub lab_man1_Click()
lab_man1.Show
End Sub
Private Sub LAB_OUTDJ_Click()
chuku_dengji.Show
End Sub
Private Sub lab_report_Click()
DataReport2.Show
End Sub
Private Sub LABINYL_Click()
ruku_liulan.Show
End Sub
Private Sub lan_outyl_Click()
chuku_liulan.Show
End Sub
Private Sub pro_info_delete_Click()
shangpin_shanchu.Show
End Sub
Private Sub pro_info_input_Click()
shangpin_luru.Show
End Sub
Private Sub pro_info_query_Click()
shangpin_chaxun.Show
End Sub
Private Sub pro_info_update_Click()
shangpin_gengxin.Show
End Sub
Private Sub rs_report_Click()
DataReport3.Show
End Sub
Private Sub updata_Click()
kucun_gengxin.Show
End Sub
Private Sub Command2_Click()
ruku_dengji.Show
End Sub
Private Sub Command3_Click()
gengxinmima.Show
End Sub
Private Sub Command4_Click()
Unload Me
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
If MsgBox("确定退出系统吗?", vbQuestion + vbYesNo + vbDefaultButton2, "退出") = vbNo Then
Cancel = 1
End If
End Sub
Private Sub chu_dengji_Click()
chuku_dengji.Show
Unload Me
End Sub
需要完整内容的请联系QQ752018766,本文免费,转发请注明源于www.youerw.com
End If
If Trim(Text2.Text) = "" Then
MsgBox "货物名不能为空", vbOKOnly + vbExclamation, ""
Text2.SetFocus
Exit Sub
End If
If Trim(Text3.Text) = "" Then
MsgBox "型号不能为空", vbOKOnly + vbExclamation, ""
Text3.SetFocus
Exit Sub
End If
If Trim(Text4.Text) = "" Then
MsgBox "单价不能为空", vbOKOnly + vbExclamation, ""
Text4.SetFocus
Exit Sub
End If
If Trim(Text5.Text) = "" Then
MsgBox "数量不能为空", vbOKOnly + vbExclamation, ""
Text5.SetFocus
Exit Sub
End If
sumprice = Text5.Text * Text4.Text
Text6.Text = sumprice
Text6.Refresh
If Not IsDate(DTPicker1.Value) Then
MsgBox "请按照 yyyy-mm-dd 格式输入日期", vbOKOnly + vbExclamation, ""
DTPicker1.Value.SetFocus
Exit Sub
End If
If Trim(Text8.Text) = "" Then
MsgBox "备注不能为空", vbOKOnly + vbExclamation, ""
Text8.SetFocus
Exit Sub
End If
sql = "select * from 入库信息 where 货物编号='" & Text1.Text & "'"
rs_addlab.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_addlab.EOF Then
rs_addlab.AddNew
rs_addlab.Fields(0) = Trim(Text1.Text)
rs_addlab.Fields(1) = Trim(Text2.Text)
rs_addlab.Fields(2) = Trim(Text3.Text)
rs_addlab.Fields(3) = Trim(Text4.Text)
rs_addlab.Fields(4) = Trim(Text5.Text)
rs_addlab.Fields(5) = Trim(Text6.Text)
rs_addlab.Fields(6) = Trim(DTPicker1.Value)
rs_addlab.Fields(7) = Trim(Text8.Text)
rs_addlab.Update
rs_addlab.Close
Else
Text1.SetFocus
Text1.Text = ""
rs_addlab.Close
End If
Dim rs_addlab1 As New ADODB.Recordset
Dim sql1 As String
sql1 = "select * from 库存信息 where 货物编号='" & Text1.Text & "'"
rs_addlab1.Open sql1, conn, adOpenKeyset, adLockPessimistic
If rs_addlab1.EOF Then
rs_addlab1.AddNew
rs_addlab1.Fields(0) = Trim(Text1.Text)
rs_addlab1.Fields(1) = Trim(Text2.Text)
rs_addlab1.Fields(2) = Trim(Text3.Text)
rs_addlab1.Fields(3) = Trim(Text4.Text)
rs_addlab1.Fields(4) = Trim(Text5.Text)
rs_addlab1.Fields(5) = Trim(Text6.Text)
rs_addlab1.Fields(6) = Trim(Text8.Text)
rs_addlab1.Update
MsgBox "入库登记成功", vbOKOnly + vbInformation, "完成"
rs_addlab1.Close
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页