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

📄 frmslog.frm

📁 超市的管理系统
💻 FRM
📖 第 1 页 / 共 2 页
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form frmSlog 
   BackColor       =   &H00FFFFC0&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "销售登记"
   ClientHeight    =   8385
   ClientLeft      =   150
   ClientTop       =   435
   ClientWidth     =   10245
   BeginProperty Font 
      Name            =   "幼圆"
      Size            =   12
      Charset         =   134
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmSlog.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   8385
   ScaleWidth      =   10245
   Begin VB.CommandButton CmdSave 
      Caption         =   "保 存(&S)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7680
      TabIndex        =   6
      Top             =   6600
      Width           =   1695
   End
   Begin VB.CommandButton CmdExit 
      Caption         =   "退 出(&E)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7680
      TabIndex        =   7
      Top             =   7320
      Width           =   1695
   End
   Begin VB.CommandButton CmdDelete 
      Caption         =   "删 除(&D)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4920
      TabIndex        =   4
      Top             =   7320
      Width           =   1575
   End
   Begin VB.CommandButton CmdGath 
      Caption         =   "收 款(&G)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   7680
      TabIndex        =   5
      Top             =   5880
      Width           =   1695
   End
   Begin VB.CommandButton CmdInput 
      Caption         =   "输 入(&I)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4920
      TabIndex        =   3
      Top             =   6600
      Width           =   1575
   End
   Begin VB.CommandButton CmdClear 
      Caption         =   "清 空(&C)"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   4920
      TabIndex        =   2
      Top             =   5880
      Width           =   1575
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FFFFC0&
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2520
      Left            =   600
      TabIndex        =   12
      Top             =   5520
      Width           =   6375
      Begin VB.TextBox txtNumber 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   350
         Left            =   1440
         TabIndex        =   11
         Top             =   1860
         Width           =   2175
      End
      Begin VB.TextBox txtDate 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   350
         Left            =   1440
         TabIndex        =   9
         Top             =   1380
         Width           =   2175
      End
      Begin VB.TextBox txtAmount 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   350
         Left            =   1440
         TabIndex        =   1
         Top             =   900
         Width           =   2175
      End
      Begin VB.TextBox txtID 
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   10.5
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   350
         Left            =   1440
         TabIndex        =   0
         Top             =   420
         Width           =   2175
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "销售序号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   240
         TabIndex        =   16
         Top             =   1920
         Width           =   960
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "销售日期"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   240
         TabIndex        =   15
         Top             =   1440
         Width           =   960
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "销售数量"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   240
         TabIndex        =   14
         Top             =   960
         Width           =   960
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "商品编号"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   240
         TabIndex        =   13
         Top             =   480
         Width           =   960
      End
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   3975
      Left            =   360
      TabIndex        =   8
      Top             =   1320
      Width           =   9500
      _ExtentX        =   16748
      _ExtentY        =   7011
      _Version        =   393216
      Cols            =   7
      FixedCols       =   0
      WordWrap        =   -1  'True
      AllowUserResizing=   1
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "销  售  信  息  登  记"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   24
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   495
      Left            =   2400
      TabIndex        =   10
      Top             =   360
      Width           =   5280
   End
End
Attribute VB_Name = "frmSlog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim n As Integer                                            'n为表中序号变量

Dim sum As Single                                           '累计金额变量

Dim num As Integer

Dim rct As New ADODB.Recordset                              '声明连接到库存表的记录集

Dim rct1 As New ADODB.Recordset                             '声明连接到销售表的记录集

Dim rct2 As New ADODB.Recordset                             '声明连接到销售单表的记录集

Private Sub flexView()                                     '定义初始条件下的表格显示

    Dim intindex As Integer

    MSFlexGrid1.ColWidth(0) = 12 * 25 * 4
    
    MSFlexGrid1.ColWidth(1) = 12 * 25 * 6
    
    MSFlexGrid1.ColWidth(2) = 12 * 25 * 9
    
    MSFlexGrid1.ColWidth(3) = 12 * 25 * 5
    
    MSFlexGrid1.ColWidth(4) = 12 * 25 * 3
    
    MSFlexGrid1.ColWidth(5) = 12 * 25 * 5
    
    MSFlexGrid1.ColWidth(6) = 12 * 25 * 6
    
    MSFlexGrid1.Row = 0
    
    For intindex = 0 To 6                                   '固定行显示格式,字体格式
    
        MSFlexGrid1.Col = intindex
        
        MSFlexGrid1.CellAlignment = 4
        
        MSFlexGrid1.CellFontBold = True
        
    Next intindex
    
    MSFlexGrid1.TextMatrix(0, 0) = "序号"
    
    MSFlexGrid1.TextMatrix(0, 1) = "商品编号"
    
    MSFlexGrid1.TextMatrix(0, 2) = "商品名称"
    
    MSFlexGrid1.TextMatrix(0, 3) = "单价/元"
    
    MSFlexGrid1.TextMatrix(0, 4) = "数量"
    
    MSFlexGrid1.TextMatrix(0, 5) = "总价/元"
    
    MSFlexGrid1.TextMatrix(0, 6) = "累计金额/元"
    
    

End Sub


Private Sub CmdClear_Click()

    n = 0
    
    MSFlexGrid1.Clear
    
    Dim X As Integer

    Dim Y As Integer

    Y = 1

    X = MSFlexGrid1.Rows - 1

    For Y = X To 2 Step -1

        MSFlexGrid1.RemoveItem (Y)

    Next Y

    Call flexView
    
    sum = 0
    
    CmdInput.Enabled = True                                               '初始化时,输入和清空按钮不可用
    
    CmdClear.Enabled = False
    
    txtID.Text = ""
                    
    txtAmount.Text = ""
            
    txtID.SetFocus
    
End Sub

Private Sub CmdInput_Click()

Dim TotalPrice As String

Dim intindex As Integer

If txtID.Text <> "" And txtAmount.Text <> "" Then

    If txtAmount > 0 Then

        Do While Not rct.EOF
            
            If rct.Fields.Item(0).Value = txtID.Text Then                 '从库存记录中找到符合条件的记录
            
                If Val(txtAmount.Text) <= rct.Fields.Item(3).Value Then   '判断库存数量是否满足购买条件
                
                    n = n + 1
                        
                    MSFlexGrid1.Row = MSFlexGrid1.Rows - 1
                    
                    For intindex = 0 To 6
    
                        MSFlexGrid1.Col = intindex
        
                        MSFlexGrid1.CellAlignment = 4
        
                    Next intindex
                
                    MSFlexGrid1.Col = 0
                
                    MSFlexGrid1.Text = n

⌨️ 快捷键说明

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