www.pudn.com > 通用库存管理系统 vb.rar > frmCK.frm
VERSION 5.00
Object = "{FAEEE763-117E-101B-8933-08002B2F4F5A}#1.1#0"; "DBLIST32.OCX"
Object = "{D959C709-8613-11D1-9840-002078110E7D}#1.0#0"; "as97Popup.ocx"
Begin VB.Form frmCK
BorderStyle = 0 'None
Caption = " 登 录"
ClientHeight = 4320
ClientLeft = 2790
ClientTop = 3150
ClientWidth = 6660
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 288
ScaleMode = 3 'Pixel
ScaleWidth = 444
ShowInTaskbar = 0 'False
Begin VB.Timer Timer3
Left = 3120
Top = 3120
End
Begin VB.Timer Timer2
Left = 3120
Top = 2160
End
Begin VB.Data Data5
Caption = "Data5"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\LeeKing\桌面\通用库管\库存管理.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 840
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "出库表"
Top = 3600
Width = 1815
End
Begin VB.Data Data4
Caption = "Data4"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\LeeKing\桌面\通用库管\库存管理.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 375
Left = 4200
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "员工表"
Top = 3600
Width = 2055
End
Begin VB.Data Data3
Caption = "Data3"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\LeeKing\桌面\通用库管\库存管理.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 4560
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "客户表"
Top = 2640
Width = 1455
End
Begin VB.TextBox Text1
ForeColor = &H00FF8080&
Height = 270
Left = 480
TabIndex = 8
Text = "0"
Top = 2280
Width = 2295
End
Begin VB.Data Data2
Caption = "Data2"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\LeeKing\桌面\通用库管\库存管理.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 3600
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "库存材料表"
Top = 1200
Width = 1695
End
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = "C:\Documents and Settings\LeeKing\桌面\通用库管\库存管理.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 285
Left = 600
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "材料分类表"
Top = 1320
Width = 1215
End
Begin VB.Timer Timer1
Left = 2880
Top = 840
End
Begin MSDBCtls.DBCombo DBCombo1
Bindings = "frmCK.frx":0000
Height = 330
Left = 480
TabIndex = 2
Top = 840
Width = 2295
_ExtentX = 4048
_ExtentY = 582
_Version = 393216
ForeColor = 16744576
ListField = "分类"
Text = ""
End
Begin MSDBCtls.DBCombo DBCombo2
Bindings = "frmCK.frx":0014
Height = 330
Left = 3600
TabIndex = 3
Top = 840
Width = 2535
_ExtentX = 4471
_ExtentY = 582
_Version = 393216
ForeColor = 16744576
ListField = "名称"
Text = ""
End
Begin MSDBCtls.DBCombo DBCombo3
Bindings = "frmCK.frx":0028
Height = 330
Left = 3720
TabIndex = 10
Top = 2280
Width = 2295
_ExtentX = 4048
_ExtentY = 582
_Version = 393216
ForeColor = 16744576
ListField = "名称"
BoundColumn = "名称"
Text = ""
End
Begin MSDBCtls.DBCombo DBCombo4
Bindings = "frmCK.frx":003C
Height = 330
Left = 3720
TabIndex = 12
Top = 3240
Width = 2295
_ExtentX = 4048
_ExtentY = 582
_Version = 393216
ForeColor = 16744576
ListField = "姓名"
BoundColumn = "姓名"
Text = ""
End
Begin as97Popup.asPopup asPopup3
Height = 615
Left = 600
ToolTipText = "校验设备"
Top = 3000
Width = 735
_ExtentX = 1296
_ExtentY = 1085
CustomPicture = "frmCK.frx":0050
MouseOverPicture= "frmCK.frx":092A
MouseDownPicture= "frmCK.frx":1204
Caption = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = 65535
BackColor = 14737632
MaskColor = 14737632
UseFrame = 0 'False
MouseOverColor = 16776960
MouseDownColor = 255
ScaleWidth = 49
ScaleMode = 0
BackStyle = 0
Object.ToolTipText = "校验设备"
End
Begin as97Popup.asPopup asPopup4
Height = 495
Left = 1920
Top = 3000
Width = 615
_ExtentX = 1085
_ExtentY = 873
CustomPicture = "frmCK.frx":151E
MouseOverPicture= "frmCK.frx":21F8
MouseDownPicture= "frmCK.frx":2ED2
Caption = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
UseFrame = 0 'False
ScaleWidth = 41
ScaleMode = 0
ScaleHeight = 33
BackStyle = 0
End
Begin VB.Label Label7
BackStyle = 0 'Transparent
Caption = "经手人:"
ForeColor = &H00FF0000&
Height = 255
Left = 3720
TabIndex = 13
Top = 3000
Width = 735
End
Begin VB.Label Label6
BackStyle = 0 'Transparent
Caption = "服务客户:"
ForeColor = &H00FF0000&
Height = 255
Left = 3720
TabIndex = 11
Top = 2040
Width = 855
End
Begin VB.Label Label8
BackStyle = 0 'Transparent
Caption = "数量:"
ForeColor = &H00FF0000&
Height = 255
Left = 480
TabIndex = 9
Top = 2040
Width = 615
End
Begin VB.Label Label5
BackStyle = 0 'Transparent
ForeColor = &H00FF0000&
Height = 255
Left = 3600
TabIndex = 7
Top = 1440
Width = 615
End
Begin VB.Label Label4
Alignment = 2 'Center
BackStyle = 0 'Transparent
ForeColor = &H000000FF&
Height = 255
Left = 2760
TabIndex = 6
Top = 1440
Width = 735
End
Begin VB.Label Label3
BackStyle = 0 'Transparent
Caption = "库存量:"
ForeColor = &H00FF0000&
Height = 255
Left = 1920
TabIndex = 5
Top = 1440
Width = 735
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "名称:"
ForeColor = &H00FF0000&
Height = 255
Left = 3600
TabIndex = 4
Top = 600
Width = 735
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "分类:"
ForeColor = &H00FF0000&
Height = 255
Left = 480
TabIndex = 1
Top = 600
Width = 735
End
Begin VB.Line Line1
BorderColor = &H00FFC0C0&
BorderWidth = 2
X1 = 8
X2 = 432
Y1 = 120
Y2 = 120
End
Begin VB.Image imgTitleMinimize
Height = 195
Left = 8160
Picture = "frmCK.frx":3BAC
Top = 120
Width = 195
End
Begin VB.Image imgTitleClose
Height = 195
Left = 8160
Picture = "frmCK.frx":3DF6
Top = 480
Width = 195
End
Begin VB.Image imgTitleHelp
Height = 195
Left = 8160
Picture = "frmCK.frx":4040
Top = 840
Width = 195
End
Begin VB.Label lblTitle
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "出库"
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 240
Left = 7200
TabIndex = 0
Top = 1200
Width = 975
End
Begin VB.Image imgTitleMain
Height = 450
Left = 6720
Picture = "frmCK.frx":428A
Stretch = -1 'True
Top = 600
Width = 285
End
Begin VB.Image imgWindowBottomRight
Height = 450
Left = 7800
Picture = "frmCK.frx":49D4
Top = 120
Width = 285
End
Begin VB.Image imgWindowRight
Height = 450
Left = 7800
Picture = "frmCK.frx":511E
Stretch = -1 'True
Top = 600
Width = 285
End
Begin VB.Image imgWindowLeft
Height = 450
Left = 7440
Picture = "frmCK.frx":5868
Stretch = -1 'True
Top = 600
Width = 285
End
Begin VB.Image imgWindowBottom
Height = 450
Left = 7080
Picture = "frmCK.frx":5FB2
Stretch = -1 'True
Top = 600
Width = 285
End
Begin VB.Image imgWindowBottomLeft
Height = 450
Left = 7440
Picture = "frmCK.frx":66FC
Top = 120
Width = 285
End
Begin VB.Image imgTitleRight
Height = 450
Left = 7080
Picture = "frmCK.frx":6E46
Top = 120
Width = 285
End
Begin VB.Image imgTitleLeft
Height = 450
Left = 6720
Picture = "frmCK.frx":7590
Top = 120
Width = 285
End
End
Attribute VB_Name = "frmCK"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub asPopup3_Click(Cancel As Boolean)
If Val(Label4.Caption) - Val(Text1.Text) < 0 Then
MsgBox "库存量不够!请及时采购。"
Exit Sub
End If
If DBCombo2.Text = "" Then
MsgBox "请选择出库材料名称!"
Exit Sub
End If
If DBCombo4.Text = "" Then
MsgBox "请选择经手人!"
Exit Sub
End If
Dim a As Integer
a = MsgBox("********你确定此操作吗?**********" & vbCrLf _
& "材料名称:" & DBCombo2.Text & vbCrLf _
& "原库存量:" & Label4.Caption & Label5.Caption & vbCrLf _
& "本次出库:" & Text1.Text & Label5.Caption & vbCrLf _
& "服务客户:" & DBCombo3.Text & vbCrLf _
& "经手人:" & DBCombo4.Text & vbCrLf _
, vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
Data5.Recordset.AddNew
Data5.Recordset("名称") = DBCombo2.Text
Data5.Recordset("用途") = DBCombo3.Text
Data5.Recordset("数量") = Text1.Text
Data5.Recordset("经手人") = DBCombo4.Text
Data5.Recordset("日期") = Date
Data5.Recordset("时间") = Time
Data5.UpdateRecord
Data5.Recordset.Bookmark = Data5.Recordset.LastModified
'************************
Data2.Recordset.Edit
Data2.Recordset("数量") = Val(Label4.Caption) - Val(Text1.Text)
Data2.Recordset.Update
MsgBox "出库完成!"
asPopup4.Enabled = True
End If
End Sub
Private Sub asPopup4_Click(Cancel As Boolean)
DataReport1.Show
DataReport1.Sections(2).Controls("Label1").Caption = "出库单据"
DataReport1.Sections(2).Controls("Label2").Caption = CStr(DBCombo2.Text)
DataReport1.Sections(2).Controls("Label3").Caption = "数量:" & CStr(Text1.Text)
DataReport1.Sections(2).Controls("Label4").Caption = "用途:" & CStr(DBCombo3.Text)
DataReport1.Sections(2).Controls("Label5").Caption = ""
DataReport1.Sections(2).Controls("Label6").Caption = "经手人:" & CStr(DBCombo4.Text)
DataReport1.Sections(2).Controls("Label7").Caption = "时间:" & CStr(Date) & " " & CStr(Time) & " " & CStr(Data5.Recordset("ID"))
asPopup4.Enabled = False
End Sub
Private Sub DBCombo2_Click(Area As Integer)
If DBCombo1.Text = "" Then
MsgBox "请先选择类别!"
Exit Sub
End If
Dim SQL As String
SQL = "SELECT ID, 分类, 单位, 名称, 备注, 数量 FROM 库存材料表 WHERE 分类 = '" & CStr(DBCombo1.Text) & "'"
Data2.Visible = False
Data2.DatabaseName = App.Path & "\库存管理.mdb"
Data2.RecordSource = SQL
Data2.Refresh
DBCombo2.Refresh
Timer1.Enabled = True
Timer1.Interval = 2000
End Sub
Private Sub DBCombo3_Click(Area As Integer)
Timer2.Enabled = True
Timer2.Interval = 2000
End Sub
Private Sub DBCombo4_Click(Area As Integer)
Timer3.Enabled = True
Timer3.Interval = 2000
End Sub
Private Sub Form_Load()
MakeWindow Me
' AlwaysOnTop Me, True
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
Data1.DatabaseName = App.Path & "\库存管理.mdb"
Data1.Connect = ";pwd=lee1012"
Data1.RecordSource = "材料分类表"
Data1.Refresh
Data1.Visible = False
Data2.DatabaseName = App.Path & "\库存管理.mdb"
Data2.Connect = ";pwd=lee1012"
Data2.RecordSource = "库存材料表"
Data2.Refresh
Data2.Visible = False
Data3.DatabaseName = App.Path & "\库存管理.mdb"
Data3.Connect = ";pwd=lee1012"
Data3.RecordSource = "客户表"
Data3.Refresh
Data3.Visible = False
Data4.DatabaseName = App.Path & "\库存管理.mdb"
Data4.Connect = ";pwd=lee1012"
Data4.RecordSource = "员工表"
Data4.Refresh
Data4.Visible = False
Data5.DatabaseName = App.Path & "\库存管理.mdb"
Data5.Connect = ";pwd=lee1012"
Data5.RecordSource = "出库表"
Data5.Refresh
Data5.Visible = False
asPopup4.Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim MyStr As String
MyStr = "通用库存管理由秦通电子有限公司开发"
MDIFrmMain.MovingText1.MsgChar = MyStr
End Sub
Private Sub imgTitleClose_Click()
Unload Me
End Sub
Private Sub imgTitleLeft_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DoDrag Me
End Sub
Private Sub imgTitleMain_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DoDrag Me
End Sub
Private Sub imgTitleMinimize_Click()
Me.WindowState = 1
End Sub
Private Sub imgTitleRight_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DoDrag Me
End Sub
Private Sub lblTitle_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
DoDrag Me
End Sub
Private Sub Timer1_Timer()
Data2.Recordset.FindFirst "名称 ='" & DBCombo2.Text & "'"
If Data2.Recordset.NoMatch = True Then
MsgBox "Err", 0, "提示"
Timer1.Enabled = False
Exit Sub
Timer1.Enabled = False
End If
Label4.Caption = Data2.Recordset("数量")
Label5.Caption = Data2.Recordset("单位")
Timer1.Enabled = False
Dim MyStr As String
MyStr = CStr(DBCombo2.Text) & " 原库存量" & CStr(Label4.Caption) & CStr(Label5.Caption)
MDIFrmMain.MovingText1.MsgChar = MyStr
End Sub
Private Sub Timer2_Timer()
If DBCombo3.Text = "" Then
MsgBox "没有选择服务客户!"
Timer2.Enabled = False
Exit Sub
End If
Data3.Recordset.FindFirst "名称 ='" & DBCombo3.Text & "'"
If Data3.Recordset.NoMatch = True Then
MsgBox "Err", 0, "提示"
Timer2.Enabled = False
Exit Sub
End If
Dim MyStr As String
MyStr = CStr(Data3.Recordset("名称")) & " 地址:" & CStr(Data3.Recordset("地址")) & " 联系人:" & CStr(Data3.Recordset("联系人")) & " 电话:" & CStr(Data3.Recordset("电话")) & " 需求产品:" & CStr(Data3.Recordset("产品")) & " 数量:" & CStr(Data3.Recordset("数量")) & " 备注:" & CStr(Data3.Recordset("备注"))
MDIFrmMain.MovingText1.MsgChar = MyStr
Timer2.Enabled = False
End Sub
Private Sub Timer3_Timer()
If DBCombo4.Text = "" Then
MsgBox "没有选择供应商!"
Timer3.Enabled = False
Exit Sub
End If
Data4.Recordset.FindFirst "姓名 ='" & DBCombo4.Text & "'"
If Data4.Recordset.NoMatch = True Then
MsgBox "Err", 0, "提示"
Timer3.Enabled = False
Exit Sub
End If
Dim MyStr As String
MyStr = CStr(Data4.Recordset("姓名")) & " 职务:" & CStr(Data4.Recordset("职务")) & " 电话:" & CStr(Data4.Recordset("电话"))
MDIFrmMain.MovingText1.MsgChar = MyStr
Timer3.Enabled = False
End Sub