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

📄 frmjinhuo.frm

📁 一个自己编写的小型超市管理系统,实现比较简单的功能,供初学者学习参考用.
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmJinhuo 
   BackColor       =   &H00FFC0C0&
   Caption         =   "进货"
   ClientHeight    =   9705
   ClientLeft      =   60
   ClientTop       =   420
   ClientWidth     =   14745
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   9705
   ScaleWidth      =   14745
   WindowState     =   2  'Maximized
   Begin VB.TextBox txtTXM 
      Appearance      =   0  'Flat
      Height          =   390
      Left            =   7440
      TabIndex        =   9
      Top             =   2280
      Width           =   1455
   End
   Begin VB.TextBox txtName 
      Appearance      =   0  'Flat
      Height          =   390
      Left            =   7440
      TabIndex        =   8
      Top             =   2880
      Width           =   1455
   End
   Begin VB.TextBox txtSC 
      Appearance      =   0  'Flat
      Height          =   390
      Left            =   7440
      TabIndex        =   7
      Top             =   3600
      Width           =   2295
   End
   Begin VB.TextBox txtGuige 
      Appearance      =   0  'Flat
      Height          =   390
      Left            =   7440
      TabIndex        =   6
      Top             =   4320
      Width           =   975
   End
   Begin VB.TextBox txtLing 
      Appearance      =   0  'Flat
      Height          =   390
      Left            =   7440
      TabIndex        =   5
      Top             =   4920
      Width           =   1455
   End
   Begin VB.TextBox txtJin 
      Appearance      =   0  'Flat
      Height          =   390
      Left            =   7440
      TabIndex        =   4
      Top             =   5520
      Width           =   1455
   End
   Begin VB.TextBox txtNumber 
      Appearance      =   0  'Flat
      Height          =   390
      Left            =   7440
      TabIndex        =   3
      Top             =   6120
      Width           =   1455
   End
   Begin VB.TextBox txtDate 
      Appearance      =   0  'Flat
      Height          =   390
      Left            =   7440
      TabIndex        =   2
      Top             =   6960
      Width           =   2535
   End
   Begin VB.CommandButton cmdQueren 
      Caption         =   "确认"
      Height          =   375
      Left            =   9720
      TabIndex        =   1
      Top             =   7920
      Width           =   1455
   End
   Begin VB.CommandButton cmdChakan 
      BackColor       =   &H80000001&
      Caption         =   "查看"
      Height          =   375
      Left            =   9360
      MaskColor       =   &H000000FF&
      TabIndex        =   0
      Top             =   2280
      Width           =   975
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "条形码"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5760
      TabIndex        =   18
      Top             =   2400
      Width           =   975
   End
   Begin VB.Label Label2 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "商品名称"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5640
      TabIndex        =   17
      Top             =   3000
      Width           =   975
   End
   Begin VB.Label Label3 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "生产厂商"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5640
      TabIndex        =   16
      Top             =   3720
      Width           =   975
   End
   Begin VB.Label Label4 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "商品规格"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5640
      TabIndex        =   15
      Top             =   4380
      Width           =   975
   End
   Begin VB.Label Label5 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "零售价"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5640
      TabIndex        =   14
      Top             =   4980
      Width           =   975
   End
   Begin VB.Label Label6 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "进价"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5640
      TabIndex        =   13
      Top             =   5580
      Width           =   975
   End
   Begin VB.Label Label7 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "采购数量"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5640
      TabIndex        =   12
      Top             =   6240
      Width           =   975
   End
   Begin VB.Label Label8 
      Alignment       =   1  'Right Justify
      BackStyle       =   0  'Transparent
      Caption         =   "采购日期"
      ForeColor       =   &H00C00000&
      Height          =   255
      Left            =   5640
      TabIndex        =   11
      Top             =   7080
      Width           =   975
   End
   Begin VB.Label Label9 
      BackStyle       =   0  'Transparent
      Caption         =   "如:2006-02-07"
      ForeColor       =   &H00C00000&
      Height          =   375
      Left            =   10200
      TabIndex        =   10
      Top             =   7140
      Width           =   1695
   End
End
Attribute VB_Name = "frmJinhuo"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rsKucun As ADODB.Recordset
Dim stqSql As String, strMsg As String
Dim flag As Boolean

Private Sub cmdChakan_Click()
    strsql = "select * from 库存表 where 条形码 = '" & txtTXM.Text & "'"
    Set rsKucun = ExecuteSQL(strsql, strMsg)
    
    If rsKucun.PageCount = 0 Then   '不存在库存记录
        flag = False
        txtName.Text = ""
        txtSC.Text = ""
        txtGuige.Text = ""
        txtLing.Text = ""
        
    Else    '存在库存记录时
        flag = True
        rsKucun.MoveFirst
        txtName.Text = rsKucun.Fields("商品名称").Value
        txtSC.Text = rsKucun.Fields("生产厂商").Value
        txtGuige.Text = rsKucun.Fields("商品规格").Value
        txtLing.Text = rsKucun.Fields("零售价").Value
    End If
End Sub

Private Sub txtTXM_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then cmdChakan_Click
End Sub
Private Sub cmdQueren_Click()
    Dim rsJinhuo As ADODB.Recordset
    
    '修改进货表
    strsql = "select * from 进货表"
    Set rsJinhuo = ExecuteSQL(strsql, strMsg)
    rsJinhuo.AddNew
    rsJinhuo.Fields("条形码").Value = txtTXM.Text
    rsJinhuo.Fields("进价").Value = txtJin.Text
    rsJinhuo.Fields("采购数量").Value = txtNumber.Text
    rsJinhuo.Fields("日期时间").Value = txtDate.Text
    rsJinhuo.UpdateBatch adAffectCurrent
    
    '修改库存表
    If flag = True Then
        rsKucun.Fields("库存量").Value = Val(rsKucun.Fields("库存量").Value) + Val(txtNumber.Text)
        rsKucun.UpdateBatch adAffectCurrent
    Else
        rsKucun.AddNew
        rsKucun.Fields("条形码") = txtTXM.Text
        rsKucun.Fields("商品名称") = txtName.Text
        rsKucun.Fields("生产厂商") = txtSC.Text
        rsKucun.Fields("库存量") = txtNumber.Text
        rsKucun.Fields("商品规格") = txtGuige.Text
        rsKucun.Fields("零售价") = txtLing.Text
        rsKucun.UpdateBatch adAffectCurrent
    End If
    
    MsgBox "提交成功!"
End Sub

⌨️ 快捷键说明

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