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

📄 frmkccx.frm

📁 ........... 开发进销存(VB6源码)
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "msflxgrd.ocx"
Begin VB.Form FrmKCCX 
   Caption         =   "库存查询"
   ClientHeight    =   7575
   ClientLeft      =   4035
   ClientTop       =   2385
   ClientWidth     =   9150
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   ScaleHeight     =   7575
   ScaleWidth      =   9150
   Begin VB.Frame Frame2 
      Caption         =   "排序方式"
      Height          =   615
      Left            =   120
      TabIndex        =   11
      Top             =   0
      Width           =   5175
      Begin VB.OptionButton Option4 
         Caption         =   "商品名称"
         Height          =   255
         Left            =   1320
         TabIndex        =   4
         Top             =   240
         Width           =   1095
      End
      Begin VB.OptionButton Option3 
         Caption         =   "仓库"
         Height          =   255
         Left            =   240
         TabIndex        =   3
         Top             =   240
         Width           =   975
      End
      Begin VB.OptionButton Option2 
         Caption         =   "数量"
         Height          =   375
         Left            =   4080
         TabIndex        =   1
         Top             =   180
         Width           =   975
      End
      Begin VB.OptionButton Option1 
         Caption         =   "货号"
         Height          =   255
         Left            =   2880
         TabIndex        =   2
         Top             =   240
         Width           =   855
      End
   End
   Begin VB.CommandButton Command3 
      Caption         =   "打  印"
      Height          =   375
      Left            =   6600
      TabIndex        =   10
      Top             =   120
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "刷  新"
      Height          =   375
      Left            =   5280
      TabIndex        =   9
      Top             =   7080
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "确  定"
      Height          =   375
      Left            =   3360
      TabIndex        =   8
      Top             =   7080
      Width           =   1095
   End
   Begin VB.TextBox TxtHH 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   1440
      TabIndex        =   7
      Top             =   7080
      Width           =   1695
   End
   Begin VB.Frame Frame1 
      Caption         =   "详细列表"
      Height          =   6255
      Left            =   120
      TabIndex        =   0
      Top             =   720
      Width           =   9015
      Begin MSFlexGridLib.MSFlexGrid Grid 
         Height          =   5895
         Left            =   120
         TabIndex        =   5
         Top             =   240
         Width           =   8775
         _ExtentX        =   15478
         _ExtentY        =   10398
         _Version        =   393216
         Cols            =   7
         FixedCols       =   0
         RowHeightMin    =   315
         SelectionMode   =   1
         FormatString    =   "仓 库 名 称 |^商品编码|^   商   品   名   称    |^  货   号  |^  规   格   |^  单   位  |^  数  量  "
      End
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "根据货号查询:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   180
      Left            =   120
      TabIndex        =   6
      Top             =   7170
      Width           =   1365
   End
End
Attribute VB_Name = "FrmKCCX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Rst As ADODB.Recordset
Dim CXFlag As Integer
Dim SQLHH As String
Private Sub Command1_Click()
    If TxtHH <> "" Then
        SQLHH = " where sp.hh like '%" & Trim(TxtHH) & "%'"
        CXFlag = 2
        Call ReSet
        Call FillGrid
    End If
End Sub

Private Sub Command2_Click()
    Call ReSet
    Call FillGrid
End Sub

Private Sub Form_Load()
    Call ReSet
    Call FillGrid
    
End Sub
Sub ReSet()
  Grid.Clear
  Grid.Rows = 1
  Grid.FormatString = "仓 库 名 称 |^商品编码|^   商   品   名   称    |^  货   号  |^  规   格   |^  单   位  |^  数  量  "

End Sub
Sub FillGrid()

    If Option1 = True Then
        PXFS = " order by sp.hh"
    ElseIf Option2 = True Then
        PXFS = " order by kcdtb.sl"
    ElseIf Option3 = True Then
        PXFS = " order by ck.ckmc"
    ElseIf Option4 = True Then
        PXFS = " order by sp.spmc"
    End If
    
    Set Rst = New Recordset
        If CXFlag = 2 Then
            SQL = "select * from KCCX " & SQLHH & PXFS
        Else
            SQL = "select * from KCCX " & PXFS
        End If
        
        Rst.Open SQL, db, 1, 3
        
    If Rst.EOF Then Exit Sub
    
    Do While Not Rst.EOF
        Grid.Rows = Grid.Rows + 1
        Grid.TextMatrix(Grid.Rows - 1, 0) = Rst.Fields(0)
        Grid.TextMatrix(Grid.Rows - 1, 1) = Rst.Fields(1)
        Grid.TextMatrix(Grid.Rows - 1, 2) = Rst.Fields(2)
        Grid.TextMatrix(Grid.Rows - 1, 3) = Rst.Fields(3)
        Grid.TextMatrix(Grid.Rows - 1, 4) = Rst.Fields(4)
        Grid.TextMatrix(Grid.Rows - 1, 5) = Rst.Fields(5)
        Grid.TextMatrix(Grid.Rows - 1, 6) = Rst.Fields(6)
        Rst.MoveNext
    Loop
    CXFlag = 0
End Sub

Private Sub Option1_Click()
    Call Command2_Click
End Sub

Private Sub Option2_Click()
    Call Command2_Click
End Sub

Private Sub Option3_Click()
    Call Command2_Click
End Sub

Private Sub Option4_Click()
    Call Command2_Click
End Sub

⌨️ 快捷键说明

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