【VB开源代码栏目提醒】:本文主要为网学会员提供device_increase.frm,希望对需要device_increase.frm网友有所帮助,学习一下!
VERSION 5.00
Begin VB.Form device_increase
Caption = "设备流入"
ClientHeight = 5565
ClientLeft = 60
ClientTop = 345
ClientWidth = 7590
LinkTopic = "Form1"
ScaleHeight = 5565
ScaleWidth = 7590
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text7
Height = 375
Left = 1800
TabIndex = 18
Top = 3960
Width = 2175
End
Begin VB.ComboBox Combo2
Height = 300
Left = 1800
Style = 2 'Dropdown List
TabIndex = 16
Top = 2160
Width = 2295
End
Begin VB.TextBox Text8
Height = 375
Left = 5400
TabIndex = 14
Top = 960
Width = 1695
End
Begin VB.CommandButton Command3
Caption = "取消"
Height = 495
Left = 3960
TabIndex = 7
Top = 4680
Width = 1215
End
Begin VB.CommandButton Command2
Caption = "流入"
Height = 495
Left = 2040
TabIndex = 6
Top = 4680
Width = 1095
End
Begin VB.TextBox Text5
Height = 375
Left = 1800
TabIndex = 5
Top = 3240
Width = 2175
End
Begin VB.TextBox Text4
Height = 375
Left = 5400
TabIndex = 4
Top = 2640
Width = 1815
End
Begin VB.TextBox Text3
Height = 375
Left = 1800
TabIndex = 3
Top = 960
Width = 2295
End
Begin VB.TextBox Text2
Height = 375
Left = 1800
TabIndex = 2
Top = 2640
Width = 1095
End
Begin VB.TextBox Text1
Height = 375
Left = 1800
TabIndex = 1
Top = 360
Width = 2295
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1800
Style = 2 'Dropdown List
TabIndex = 0
Top = 1560
Width = 2295
End
Begin VB.Label Label8
Caption = "进库日期:"
Height = 375
Left = 480
TabIndex = 19
Top = 3960
Width = 1095
End
Begin VB.Label Label10
Caption = "所属系部:"
Height = 375
Left = 480
TabIndex = 17
Top = 2160
Width = 1215
End
Begin VB.Label Label9
Caption = "型号:"
Height = 375
Left = 4680
TabIndex = 15
Top = 960
Width = 1095
End
Begin VB.Label Label6
Caption = "价格:"
Height = 375
Left = 4680
TabIndex = 13
Top = 2640
Width = 1095
End
Begin VB.Label Label5
Caption = "购买日期:"
Height = 375
Left = 480
TabIndex = 12
Top = 3360
Width = 1095
End
Begin VB.Label Label4
Caption = "折旧率:"
Height = 375
Left = 480
TabIndex = 11
Top = 2760
Width = 855
End
Begin VB.Label Label3
Caption = "名称"
Height = 375
Left = 480
TabIndex = 10
Top = 960
Width = 1095
End
Begin VB.Label Label1
Caption = "设备编号:"
Height = 375
Left = 480
TabIndex = 9
Top = 360
Width = 1095
End
Begin VB.Label Label2
Caption = "类别:"
Height = 375
Left = 480
TabIndex = 8
Top = 1560
Width = 1215
End
End
Attribute VB_Name = "device_increase"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command2_Click()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from info_device where dno='" & Text1.Text & "'"
rs.Open sql, cn, 1, 1
If rs.EOF <> True Then
MsgBox "该设备编号已经存在"
Text1.Text = ""
Text1.SetFocus
Else
rs.Close
sql = "select * from info_device "
rs.Open sql, cn, 3, 2
rs.AddNew
rs("dname") = Text3.Text
rs("dmodule") = Text8.Text
rs("dtype") = Combo1.Text
rs("ddept") = Combo2.Text
rs("dzj") = Text2.Text
rs("dprice") = Text4.Text
rs("dbdate") = Text5.Text
rs("ddate") = Text7.Text
rs.Update
MsgBox "该设备已流入系统"
End If
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Sub Form_Load()
Set cn = New ADODB.Connection
Set rs = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\file.mdb;Persist Security Info=False"
sql = "select * from type "
rs.Open sql, cn, 1, 1
Do While rs.EOF <> True
Combo1.AddItem rs("tname")
rs.MoveNext
Loop
rs.Close
sql = "select * from dept "
rs.Open sql, cn, 1, 1
Do While rs.EOF <> True
Combo2.AddItem rs("dename")
rs.MoveNext
Loop
End Sub