⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmwlsjsr.frm

📁 物流管理系统实例程序
💻 FRM
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form frmWlSjsr 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "物品流通处理"
   ClientHeight    =   4815
   ClientLeft      =   2760
   ClientTop       =   3750
   ClientWidth     =   5550
   Icon            =   "frmWlSjsr.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4815
   ScaleWidth      =   5550
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  '所有者中心
   Begin VB.Frame Frame1 
      Height          =   4215
      Left            =   120
      TabIndex        =   4
      Top             =   0
      Width           =   5295
      Begin VB.CommandButton comdPut 
         Caption         =   "提交(&P)"
         Height          =   360
         Left            =   3600
         TabIndex        =   2
         Top             =   480
         Width           =   1335
      End
      Begin MSComCtl2.UpDown updSl 
         Height          =   300
         Left            =   2640
         TabIndex        =   15
         Top             =   1440
         Width           =   510
         _ExtentX        =   900
         _ExtentY        =   529
         _Version        =   393216
         Value           =   1
         BuddyControl    =   "txtSl"
         BuddyDispid     =   196612
         OrigLeft        =   2760
         OrigTop         =   1440
         OrigRight       =   3270
         OrigBottom      =   1740
         Max             =   9999
         Min             =   1
         Orientation     =   1
         SyncBuddy       =   -1  'True
         BuddyProperty   =   0
         Enabled         =   -1  'True
      End
      Begin VB.TextBox txtSm 
         Height          =   1575
         Left            =   240
         MaxLength       =   100
         MultiLine       =   -1  'True
         ScrollBars      =   2  'Vertical
         TabIndex        =   1
         Top             =   2400
         Width           =   4815
      End
      Begin VB.TextBox txtSl 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "0"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   1
         EndProperty
         Height          =   300
         IMEMode         =   3  'DISABLE
         Left            =   1080
         MaxLength       =   4
         TabIndex        =   0
         Text            =   "1"
         Top             =   1440
         Width           =   1575
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "说明:"
         Height          =   180
         Index           =   3
         Left            =   240
         TabIndex        =   14
         Top             =   2160
         Width           =   450
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "物品ID:"
         Height          =   180
         Index           =   5
         Left            =   240
         TabIndex        =   13
         Top             =   360
         Width           =   630
      End
      Begin VB.Label lblID 
         BorderStyle     =   1  'Fixed Single
         Height          =   300
         Left            =   1080
         TabIndex        =   12
         Top             =   360
         Width           =   2055
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "物品名称:"
         Height          =   180
         Index           =   0
         Left            =   240
         TabIndex        =   11
         Top             =   720
         Width           =   810
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "单价(元):"
         Height          =   180
         Index           =   4
         Left            =   240
         TabIndex        =   10
         Top             =   1080
         Width           =   810
      End
      Begin VB.Label lblMc 
         BorderStyle     =   1  'Fixed Single
         Height          =   300
         Left            =   1080
         TabIndex        =   9
         Top             =   720
         Width           =   2055
      End
      Begin VB.Label lblDj 
         BorderStyle     =   1  'Fixed Single
         Caption         =   "12.5"
         Height          =   300
         Left            =   1080
         TabIndex        =   8
         Top             =   1080
         Width           =   2055
      End
      Begin VB.Label lblSlBq 
         AutoSize        =   -1  'True
         Caption         =   "数量:"
         Height          =   180
         Left            =   240
         TabIndex        =   7
         Top             =   1440
         Width           =   450
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "价值(元):"
         Height          =   180
         Index           =   2
         Left            =   240
         TabIndex        =   6
         Top             =   1800
         Width           =   810
      End
      Begin VB.Label lblJz 
         BorderStyle     =   1  'Fixed Single
         Height          =   300
         Left            =   1080
         TabIndex        =   5
         Top             =   1800
         Width           =   2055
      End
   End
   Begin VB.CommandButton comdExit 
      Cancel          =   -1  'True
      Caption         =   "关闭"
      Height          =   360
      Left            =   3720
      TabIndex        =   3
      Top             =   4380
      Width           =   1335
   End
End
Attribute VB_Name = "frmWlSjsr"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public bytLx As Byte

Private Sub comdExit_Click()
    Unload Me
End Sub

Private Sub comdPut_Click()
    Dim strLx As String
    Dim intSl As Integer
    Dim intKcl As Integer
    Dim rs As ADODB.Recordset
    On Error Resume Next
    Set rs = mCdt.rsWPKCL(lblID)
    intKcl = rs("库存量")
    rs.Close
    
    Select Case bytLx
        Case 0
            intSl = Abs(txtSl)
            strLx = "进库"
            
            
        Case 1
            intSl = -Abs(txtSl)
            If intKcl + intSl < 0 Then
                MsgBox "现有库存量是:" & intKcl & _
                 ",不能满足数量是:" & txtSl & " 的出库操作!", vbInformation
                Exit Sub
            End If
            strLx = "出库"
        Case 2
            intSl = -Abs(txtSl)
            If intKcl + intSl < 0 Then
                MsgBox "现有库存量是:" & intKcl & _
                 ",不能满足数量是:" & txtSl & " 的报损操作!", vbInformation
                Exit Sub
            End If
            strLx = "报损"
    End Select
    
    mCdt.InsWL lblID, strLx, intSl, gstrZyID, Date, txtSm, True
    MsgBox "操作成功,库存量已改变为:" & intKcl + intSl, vbInformation
End Sub

Private Sub Form_Activate()
    lblJz = txtSl * lblDj
End Sub

Private Sub txtSl_Change()
    If Val(txtSl) = 0 Then
        txtSl = 1
    Else
        txtSl = Abs(Val(txtSl))
    End If
    lblJz = txtSl * lblDj
End Sub

Private Sub txtSl_GotFocus()
    txtSl.SelStart = 0
    txtSl.SelLength = Len(txtSl)
End Sub

Private Sub txtSl_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyDown Then
        txtSl = Val(txtSl) - 1
    ElseIf KeyCode = vbKeyUp Then
        txtSl = Val(txtSl) + 1
    End If
End Sub

Private Sub updSl_Change()
    txtSl.SetFocus
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -