tjxiaoshou.frm

来自「一套VB完整的灯具销售管理系统设计」· FRM 代码 · 共 368 行

FRM
368
字号
VERSION 5.00
Object = "{00028C01-0000-0000-0000-000000000046}#1.0#0"; "DBGRID32.OCX"
Begin VB.Form TjXiaoshou 
   AutoRedraw      =   -1  'True
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   5070
   ClientLeft      =   45
   ClientTop       =   45
   ClientWidth     =   6570
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5070
   ScaleWidth      =   6570
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton XianXi 
      Caption         =   "详细资料"
      Enabled         =   0   'False
      Height          =   375
      Left            =   4815
      TabIndex        =   14
      Top             =   3240
      Width           =   1080
   End
   Begin VB.TextBox RQHide2 
      Enabled         =   0   'False
      Height          =   285
      Left            =   5085
      TabIndex        =   11
      Top             =   555
      Width           =   900
   End
   Begin VB.TextBox RqHide 
      Enabled         =   0   'False
      Height          =   285
      Left            =   3840
      TabIndex        =   10
      Top             =   555
      Width           =   900
   End
   Begin VB.CommandButton PrintTjXiaoshou 
      Caption         =   "打印统计"
      Enabled         =   0   'False
      Height          =   375
      Left            =   4815
      TabIndex        =   9
      Top             =   3660
      Width           =   1080
   End
   Begin VB.CommandButton Sure 
      Caption         =   "开始统计"
      Default         =   -1  'True
      Enabled         =   0   'False
      Height          =   375
      Left            =   4815
      TabIndex        =   8
      Top             =   2820
      Width           =   1080
   End
   Begin VB.CommandButton Closeform 
      Cancel          =   -1  'True
      Caption         =   "退出(&X)"
      Height          =   375
      Left            =   4815
      TabIndex        =   7
      Top             =   4080
      Width           =   1080
   End
   Begin VB.Frame Frame1 
      Caption         =   "选择统计方式"
      ForeColor       =   &H00004080&
      Height          =   1500
      Left            =   4575
      TabIndex        =   4
      Top             =   1155
      Width           =   1440
      Begin VB.OptionButton Option2 
         Caption         =   "活动日期"
         Height          =   240
         Left            =   225
         TabIndex        =   6
         Top             =   1005
         Width           =   1125
      End
      Begin VB.OptionButton Option1 
         Caption         =   "固定日期"
         Height          =   330
         Left            =   225
         TabIndex        =   5
         Top             =   525
         Width           =   1095
      End
   End
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  'DefaultCursor
      DefaultType     =   2  'UseODBC
      Exclusive       =   0   'False
      Height          =   285
      Left            =   7410
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   2115
      Width           =   1140
   End
   Begin MSDBGrid.DBGrid DBGrid1 
      Bindings        =   "TjXiaoshou.frx":0000
      Height          =   3435
      Left            =   510
      OleObjectBlob   =   "TjXiaoshou.frx":0010
      TabIndex        =   3
      Top             =   1005
      Width           =   3915
   End
   Begin VB.Label Label3 
      Caption         =   "至"
      ForeColor       =   &H00C000C0&
      Height          =   195
      Left            =   4800
      TabIndex        =   13
      Top             =   600
      Width           =   210
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      Caption         =   "时间:"
      ForeColor       =   &H00FF0000&
      Height          =   180
      Left            =   3240
      TabIndex        =   12
      Top             =   585
      Width           =   540
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "销售龙虎榜"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   315
      Index           =   2
      Left            =   1125
      TabIndex        =   2
      ToolTipText     =   "单击,显示所有产品……排行榜……"
      Top             =   525
      Width           =   1665
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "销售龙虎榜"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   315
      Index           =   1
      Left            =   1155
      TabIndex        =   1
      Top             =   525
      Width           =   1665
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "销售龙虎榜"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   315
      Index           =   0
      Left            =   1095
      TabIndex        =   0
      Top             =   525
      Width           =   1665
   End
   Begin VB.Line Line8 
      BorderColor     =   &H00FFFFFF&
      X1              =   6270
      X2              =   6270
      Y1              =   240
      Y2              =   4785
   End
   Begin VB.Line Line7 
      BorderColor     =   &H00808080&
      X1              =   6165
      X2              =   6165
      Y1              =   330
      Y2              =   4665
   End
   Begin VB.Line Line6 
      X1              =   255
      X2              =   6270
      Y1              =   240
      Y2              =   240
   End
   Begin VB.Line Line5 
      BorderColor     =   &H00FFFFFF&
      X1              =   345
      X2              =   6165
      Y1              =   330
      Y2              =   330
   End
   Begin VB.Line Line4 
      BorderColor     =   &H00FFFFFF&
      X1              =   240
      X2              =   6270
      Y1              =   4785
      Y2              =   4785
   End
   Begin VB.Line Line3 
      BorderColor     =   &H00808080&
      X1              =   330
      X2              =   6180
      Y1              =   4665
      Y2              =   4665
   End
   Begin VB.Line Line2 
      X1              =   240
      X2              =   240
      Y1              =   240
      Y2              =   4800
   End
   Begin VB.Line Line1 
      BorderColor     =   &H00FFFFFF&
      X1              =   330
      X2              =   330
      Y1              =   330
      Y2              =   4635
   End
End
Attribute VB_Name = "TjXiaoshou"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CloseForm_Click()
Unload Me
End Sub

Private Sub Form_Load()
Option1.Value = False
Option2.Value = False
Data1.DatabaseName = appData
RecordStr = "select 品名 as CpMC,sum(数量) as XiaoShouZS from fpk group by 品名 order by Sum(数量) DESC"
Data1.RecordSource = RecordStr
Data1.Refresh
End Sub

Private Sub Label1_Click(Index As Integer)
RecordStr = "select 品名 as CpMC,sum(数量) as XiaoShouZS from fpk"
RecordStr = RecordStr & " group by 品名 order by Sum(数量) DESC"
Data1.RecordSource = RecordStr
Data1.Refresh
RqHide.Text = ""
RQHide2.Text = ""
End Sub

Private Sub Option1_Click()
RqHide.Text = ""
TjXiaoshou.MousePointer = 11
Load TjRqForm
TjXiaoshou.MousePointer = 0
TjRqForm.Show 1
End Sub

Private Sub Option1_DblClick()
RqHide.Text = ""
TjXiaoshou.MousePointer = 11
Load TjRqForm
TjXiaoshou.MousePointer = 0
TjRqForm.Show 1
End Sub

Private Sub Option2_Click()
RqHide.Text = ""
RQHide2.Text = ""
TjXiaoshou.MousePointer = 11
Load TjRqForm2
TjXiaoshou.MousePointer = 0
TjRqForm2.Show 1
End Sub

Private Sub Option2_DblClick()
RqHide.Text = ""
RQHide2.Text = ""
TjXiaoshou.MousePointer = 11
Load TjRqForm2
TjXiaoshou.MousePointer = 0
TjRqForm2.Show 1
End Sub

Private Sub RqHide_Change()
If Trim(RqHide.Text) = "" Then
   XianXi.Enabled = False
   Sure.Enabled = False
   Else
   Sure.Enabled = True
   XianXi.Enabled = True
   End If
End Sub

Private Sub Sure_Click()
On Error GoTo rqerr
If Option1.Value = True Then
RecordStr = "select 品名 as CpMC,sum(数量) as XiaoShouZS from fpk where "
RecordStr = RecordStr & "日期=#" & RqHide.Text & "# group by 品名 order by Sum(数量) DESC"
Data1.RecordSource = RecordStr
Data1.Refresh
If Data1.Recordset.RecordCount = 0 Then
   XianXi.Enabled = False
   Else
   XianXi.Enabled = True
   End If
Exit Sub
End If
If Option2.Value = True Then
  If RQHide2.Text = "" Then RQHide2.Text = RqHide.Text
RecordStr = "select 品名 as CpMC,sum(数量) as XiaoShouZS from fpk where "
RecordStr = RecordStr & "日期 Between #" & RqHide.Text & "# and #" & RQHide2.Text & "# group by 品名 order by Sum(数量) DESC"
Data1.RecordSource = RecordStr
Data1.Refresh
If Data1.Recordset.RecordCount = 0 Then
   XianXi.Enabled = False
   Else
   XianXi.Enabled = True
   End If
Exit Sub
End If
rqerr:
   MsgBox "日期格式不对 或 日份范围有误!", vbOKOnly + 32, "格式不对"
   Exit Sub
End Sub

Private Sub XianXi_Click()
TjXiaoshou.MousePointer = 11
Load TjXianxi
TjXiaoshou.MousePointer = 0
TjXianxi.Show 1
End Sub

⌨️ 快捷键说明

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