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

📄 chukuxiugai.frm

📁 明珠大厦相机组库存管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Begin VB.Form chukuxiugai 
   Caption         =   "出库记录修改"
   ClientHeight    =   7620
   ClientLeft      =   60
   ClientTop       =   465
   ClientWidth     =   10605
   LinkTopic       =   "Form1"
   ScaleHeight     =   7620
   ScaleWidth      =   10605
   StartUpPosition =   3  '窗口缺省
   Begin VB.TextBox Text3 
      Enabled         =   0   'False
      Height          =   270
      Left            =   8520
      TabIndex        =   19
      Top             =   2880
      Width           =   975
   End
   Begin VB.ListBox List1 
      Height          =   2220
      Left            =   7800
      TabIndex        =   17
      Top             =   3480
      Width           =   1935
   End
   Begin VB.Frame Frame2 
      Caption         =   "待修改批次"
      Height          =   735
      Left            =   8400
      TabIndex        =   16
      Top             =   2520
      Width           =   1335
   End
   Begin VB.TextBox Text1 
      Enabled         =   0   'False
      Height          =   270
      Left            =   8520
      TabIndex        =   15
      Top             =   2760
      Width           =   975
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   4800
      TabIndex        =   7
      Top             =   480
      Width           =   1695
   End
   Begin VB.ComboBox Combo2 
      Height          =   300
      Left            =   7920
      TabIndex        =   6
      Top             =   480
      Width           =   1695
   End
   Begin VB.TextBox Text2 
      Height          =   375
      Left            =   5760
      TabIndex        =   5
      Top             =   1800
      Width           =   1695
   End
   Begin VB.ComboBox Combo3 
      Height          =   300
      Left            =   1800
      TabIndex        =   4
      Top             =   1800
      Width           =   1695
   End
   Begin VB.Frame Frame1 
      Caption         =   "提示"
      Height          =   2655
      Left            =   600
      TabIndex        =   2
      Top             =   2880
      Width           =   6375
      Begin VB.Label Label10 
         Caption         =   "型号一栏填入要修改的产品型号,如果这一天有多次入库,注意选择批次"
         Height          =   375
         Left            =   240
         TabIndex        =   22
         Top             =   840
         Width           =   5895
      End
      Begin VB.Label Label9 
         Caption         =   "注意:灰色字体的待修改批次才是真正要修改的批次"
         ForeColor       =   &H00FF0000&
         Height          =   375
         Left            =   240
         TabIndex        =   21
         Top             =   1320
         Width           =   4335
      End
      Begin VB.Label Label11 
         Caption         =   "只有选中列表中的批次才能够对产品进行修改"
         Height          =   375
         Left            =   240
         TabIndex        =   20
         Top             =   1800
         Width           =   3975
      End
      Begin VB.Label Label5 
         Caption         =   "注意输入合理的数值"
         Height          =   375
         Left            =   240
         TabIndex        =   3
         Top             =   360
         Width           =   4215
      End
   End
   Begin VB.CommandButton Command1 
      Caption         =   "修     改"
      Height          =   1095
      Left            =   1200
      TabIndex        =   1
      Top             =   6240
      Width           =   2415
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退     出"
      Height          =   1095
      Left            =   6360
      TabIndex        =   0
      Top             =   6240
      Width           =   2775
   End
   Begin MSComCtl2.DTPicker DTPicker1 
      Height          =   375
      Left            =   1800
      TabIndex        =   8
      Top             =   480
      Width           =   1815
      _ExtentX        =   3201
      _ExtentY        =   661
      _Version        =   393216
      Format          =   25493505
      CurrentDate     =   39232
   End
   Begin VB.Label Label8 
      Caption         =   "批次:"
      Height          =   375
      Left            =   7680
      TabIndex        =   18
      Top             =   3000
      Width           =   735
   End
   Begin VB.Label Label1 
      Caption         =   "产品分类"
      Height          =   375
      Left            =   3960
      TabIndex        =   14
      Top             =   480
      Width           =   735
   End
   Begin VB.Label Label2 
      Caption         =   "品牌"
      Height          =   375
      Left            =   7080
      TabIndex        =   13
      Top             =   480
      Width           =   735
   End
   Begin VB.Label Label3 
      Caption         =   "型号"
      Height          =   375
      Left            =   960
      TabIndex        =   12
      Top             =   1800
      Width           =   1215
   End
   Begin VB.Label Label4 
      Caption         =   "数量"
      Height          =   375
      Left            =   5040
      TabIndex        =   11
      Top             =   1800
      Width           =   1095
   End
   Begin VB.Label Label6 
      Caption         =   "出库日期"
      Height          =   375
      Left            =   720
      TabIndex        =   10
      Top             =   480
      Width           =   1095
   End
   Begin VB.Label Label7 
      Caption         =   "修改成功"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   21.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   615
      Left            =   7800
      TabIndex        =   9
      Top             =   1680
      Visible         =   0   'False
      Width           =   2055
   End
End
Attribute VB_Name = "chukuxiugai"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False



Private Sub Command1_Click()

If Combo1.Text = "" Or Combo2.Text = "" Or Combo3.Text = "" Or Text2 = "" Or Text3 = "" Or Not IsNumeric(Text3) Or Not IsNumeric(Text2) Or Text2 < 1 Then
Exit Sub
Else




Dim rst As Recordset
    Dim db As Connection
    Set rst = New Recordset
  
   ' Set rs2 = New Recordset
    Set db = New Connection
    conn = "select * from 产品类别 where 类别名称 ='" & Combo1 & "'"
    
    db.CursorLocation = adUseClient
    db.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Database.mdb;Persist Security Info=False"
    rst.Open conn, db, adOpenDynamic, adLockOptimistic

    If Not rst.EOF Then
    aaa = rst.Fields("id")
    Else
   
   
        X = MsgBox("是否添加新类别:" & Combo1.Text & "?", vbOKCancel)
        
        If X = 1 Then
            conn = "insert into 产品类别(类别名称) values ('" & Combo1 & "')"
            rst.Close

            rst.Open conn, db, adOpenDynamic, adLockOptimistic
            MsgBox "类别添加成功"
            conn = "select * from 产品类别 where 类别名称 ='" & Combo1 & "'"
            rst.Open conn, db, adOpenDynamic, adLockOptimistic
            aaa = rst.Fields("id")
        Else
            Exit Sub
        End If
   
   
    End If
rst.Close




conn = "select * from 生产厂家 where 品牌 ='" & Combo2 & "'"

rst.Open conn, db, adOpenDynamic, adLockOptimistic

  If Not rst.EOF Then
    bbb = rst.Fields("id")
    
    Else
    
     X = MsgBox("是否添加新品牌:" & Combo2.Text & "?", vbOKCancel)
        If X = 1 Then
        conn = "insert into 生产厂家(品牌) values ('" & Combo2 & "')"
        rst.Close
        rst.Open conn, db, adOpenDynamic, adLockOptimistic
        MsgBox "品牌添加成功"
        conn = "select * from 生产厂家 where 品牌 ='" & Combo2 & "'"
        rst.Open conn, db, adOpenDynamic, adLockOptimistic
        bbb = rst.Fields("id")
        Else
            Exit Sub
        End If
    
    End If
rst.Close





conn = "select * from 产品库存 where 生产厂家=" & bbb & " and 产品类别=" & aaa & " and 产品型号='" & Combo3 & "'"
 rst.Open conn, db, adOpenDynamic, adLockOptimistic

    If rst.EOF Then
   
        MsgBox "无此产品"
        Exit Sub
    Else
    
    
    
        rst.MoveFirst
        ccc = rst.Fields("数量")
        ddd = 0
        'Debug.Print ccc & "ccc"
        rst.MoveNext
        Do Until rst.EOF
            ccc = ccc + rst.Fields("数量")
            rst.MoveNext
        Loop
    
        rst.Close
    
        conn = "select * from 产品出库 where 生产厂家=" & bbb & " and 产品类别=" & aaa & " and 产品型号='" & Combo3 & "'"

        rst.Open conn, db, adOpenDynamic, adLockOptimistic

        If Not rst.EOF Then
            rst.MoveFirst
    
            ddd = rst.Fields("数量")
     
            rst.MoveNext
            Do Until rst.EOF
                ddd = ddd + rst.Fields("数量")
                rst.MoveNext
            Loop
    

     
     
            
        End If
    
    
    End If
rst.Close


conn = "select * from 产品出库 where id=" & Text3

rst.Open conn, db, adOpenDynamic, adLockOptimistic
   eee = rst.Fields("数量")

rst.Close


'Debug.Print ddd
'Debug.Print eee
If CInt(Text2) > (ccc - ddd + eee) Then
    
MsgBox "出货大于库存,请检查输入"
Exit Sub
End If











⌨️ 快捷键说明

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