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

📄 frmckxg.frm

📁 很好用的通用库存管理程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmCkXG 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "出库物资修改"
   ClientHeight    =   4590
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   3390
   ControlBox      =   0   'False
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   4590
   ScaleWidth      =   3390
   Begin VB.TextBox Text1 
      ForeColor       =   &H80000006&
      Height          =   270
      Left            =   1200
      TabIndex        =   0
      Top             =   2400
      Width           =   1935
   End
   Begin VB.CommandButton Command1 
      Caption         =   "保 存"
      Height          =   495
      Left            =   360
      TabIndex        =   3
      Top             =   3960
      Width           =   1095
   End
   Begin VB.CommandButton Command2 
      Caption         =   "取  消"
      Height          =   495
      Left            =   2040
      TabIndex        =   2
      Top             =   3960
      Width           =   1095
   End
   Begin VB.TextBox Text3 
      ForeColor       =   &H80000006&
      Height          =   735
      Left            =   1200
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   1
      Top             =   2880
      Width           =   1935
   End
   Begin VB.Label LabNums 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabNums"
      Height          =   180
      Left            =   1320
      TabIndex        =   16
      Top             =   1560
      Width           =   630
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "库存量"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   15
      Top             =   1560
      Width           =   615
   End
   Begin VB.Label LabDW 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabModel"
      Height          =   180
      Left            =   1320
      TabIndex        =   14
      Top             =   840
      Width           =   1680
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "单  位"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   13
      Top             =   840
      Width           =   615
   End
   Begin VB.Label LabName 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabName"
      Height          =   180
      Left            =   1320
      TabIndex        =   12
      Top             =   120
      Width           =   1215
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "配件名称:"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   11
      Top             =   120
      Width           =   735
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00FFC0C0&
      BorderWidth     =   3
      X1              =   0
      X2              =   3360
      Y1              =   1920
      Y2              =   1920
   End
   Begin VB.Label Label8 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "入库数量"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   240
      TabIndex        =   10
      Top             =   2400
      Width           =   720
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "单  价"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   9
      Top             =   1200
      Width           =   615
   End
   Begin VB.Label Label10 
      BackStyle       =   0  'Transparent
      Caption         =   "规格型号"
      ForeColor       =   &H00FF0000&
      Height          =   255
      Left            =   240
      TabIndex        =   8
      Top             =   480
      Width           =   855
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "出库物资修改"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00008000&
      Height          =   255
      Left            =   840
      TabIndex        =   7
      Top             =   2040
      Width           =   1695
   End
   Begin VB.Label LabModel 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabModel"
      Height          =   180
      Left            =   1320
      TabIndex        =   6
      Top             =   480
      Width           =   1680
   End
   Begin VB.Label LabDJ 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "LabDJ"
      Height          =   180
      Left            =   1320
      TabIndex        =   5
      Top             =   1200
      Width           =   1290
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "备 注"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   360
      TabIndex        =   4
      Top             =   3120
      Width           =   450
   End
End
Attribute VB_Name = "FrmCkXG"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim Nums As Integer
Dim TotolNums As Integer
Private Sub Command1_Click()
If Val(Text1.Text) <= 0 Or Text1.Text = "" Then
 MsgBox "请输入出库数量!"
 Exit Sub
End If

Dim a As Integer
 a = MsgBox("********你确定进行修改吗?**********" & vbCrLf _
        & "配件名称:" & LabName.Caption & vbCrLf _
        & "本次出库:" & Text1.Text & LabDW.Caption & "   单价:" & LabDJ.Caption & "元" & vbCrLf _
        , vbExclamation + vbOKCancel + vbApplicationModal, "提示")
If a = 1 Then
  
     sSql = "SELECT * FROM 配件库存表  where 配件名称 = '" & CStr(LabName.Caption) & "'"
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
     TotolNums = Rs.Fields("数量") - Val(Text1.Text) + Nums
     If TotolNums < 0 Then
       MsgBox "请输入正确的出库数量,出库数量不准超过库存量!"
       Rs.Close
      Exit Sub
     End If
         Rs!数量 = TotolNums
         Rs.Update
         Rs.Close
     
  
      sSql = "SELECT * FROM 出库物资 where ID =" & RemId
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
   Rs!数量 = Text1.Text
   Rs!金额 = Val(Text1.Text) * Val(LabDJ.Caption)
   
   If Text3.Text = "" Then Rs!备注 = "-" Else Rs!备注 = Text3.Text
   Rs.Update
   Rs.Close
  MsgBox "修改成功!"
FrmCKList.Show
Unload Me
End If
If a = 2 Then Exit Sub
End Sub

Private Sub Command2_Click()
FrmCKList.Show
Unload Me
End Sub

Private Sub Form_Load()
Me.Top = MDIFrmMain.Height / 2 - Me.Height / 2 - 1000
Me.Left = MDIFrmMain.Width / 2 - Me.Width / 2
 Set Rs = New Recordset
Set_Int
End Sub
Private Sub Set_Int()
 'On Error GoTo DataErr
    sSql = "SELECT * FROM 出库物资 where ID =" & RemId
 Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText

 LabName.Caption = Rs.Fields("配件名称")
 LabModel.Caption = Rs.Fields("规格型号")
 LabDW.Caption = Rs.Fields("单位")
 LabDJ.Caption = Rs.Fields("单价")
 Nums = Rs.Fields("数量")
 Text1.Text = Rs.Fields("数量")

 If Rs.Fields("备注") = "-" Then Text3.Text = "" Else Text3.Text = Rs.Fields("备注")

Rs.Close
     sSql = "SELECT * FROM 配件库存表  where 配件名称 = '" & LabName.Caption & "'"
     Rs.Open sSql, db, adOpenKeyset, adLockOptimistic, adCmdText
     LabNums.Caption = Rs!数量
     Rs.Close
  Exit Sub
'DataErr:
 '    MsgBox Err.Description
End Sub

⌨️ 快捷键说明

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