📄 frmck.frm
字号:
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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -