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

📄 frmcheckfind.frm

📁 VB编写的超市管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form frmCheckFind 
   BackColor       =   &H00C0E0FF&
   BorderStyle     =   1  'Fixed Single
   Caption         =   "库存查询"
   ClientHeight    =   6555
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   8940
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   6555
   ScaleWidth      =   8940
   StartUpPosition =   2  'CenterScreen
   Begin VB.CommandButton cmdPrint 
      Caption         =   "打印"
      Height          =   375
      Left            =   7320
      TabIndex        =   6
      Top             =   1680
      Width           =   855
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   3735
      Left            =   720
      TabIndex        =   5
      Top             =   2520
      Width           =   7815
      _ExtentX        =   13785
      _ExtentY        =   6588
      _Version        =   393216
   End
   Begin VB.CommandButton cmdFind 
      Caption         =   "查询"
      Height          =   375
      Left            =   6120
      TabIndex        =   4
      Top             =   1680
      Width           =   855
   End
   Begin VB.TextBox txtData 
      Height          =   375
      Left            =   3000
      TabIndex        =   3
      Top             =   1680
      Width           =   3015
   End
   Begin VB.ComboBox cboType 
      Height          =   315
      ItemData        =   "frmCheckFind.frx":0000
      Left            =   3000
      List            =   "frmCheckFind.frx":0025
      Style           =   2  'Dropdown List
      TabIndex        =   1
      Top             =   960
      Width           =   3015
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "输入框*"
      Height          =   195
      Index           =   1
      Left            =   2160
      TabIndex        =   2
      Top             =   1680
      Width           =   600
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "查询方式"
      Height          =   195
      Index           =   0
      Left            =   2160
      TabIndex        =   0
      Top             =   960
      Width           =   720
   End
End
Attribute VB_Name = "frmCheckFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Sql As String
Dim RS As ADODB.Recordset

Private Sub cmdFind_Click()
'查找
If Trim(Me.txtData.Text) <> "" Then
    Sql = "select * from 商品表 where "
    Sql = Sql & Trim(Me.cboType.Text)
    If Me.cboType.ListIndex = 0 Or Me.cboType.ListIndex = 3 _
        Or Me.cboType.ListIndex = 5 Or Me.cboType.ListIndex = 6 _
        Or Me.cboType.ListIndex = 7 Then
        Sql = Sql & "=" & Trim(Me.txtData.Text)
    Else
        Sql = Sql & "='" & Trim(Me.txtData.Text) & "'"
    End If
    writeMS Sql, Me.MSFlexGrid1
Else
    MsgBox "主键不能为空!"
    Me.txtData.SetFocus
End If
End Sub
Private Sub cmdPrint_Click()
writeMSFlexGrid Me.MSFlexGrid1, "库存盘点"
End Sub

Private Sub MSFlexGrid1_Click()
Call MSFlexGrid1_RowColChange
End Sub

Private Sub MSFlexGrid1_RowColChange()
'添加到基本信息窗体中
Dim i As Integer
If Me.MSFlexGrid1.Row > 0 And Me.MSFlexGrid1.Row < Me.MSFlexGrid1.Rows - 1 Then
    frmCheckOther.Show
    frmCheckOther.txtMonth.SetFocus
    frmCheckOther.txtNo.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 0)
    frmCheckOther.txtName.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 1)
    For i = 0 To frmCheckOther.cboType.ListCount - 1
        If frmCheckOther.cboType.List(i) = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 2) Then
            frmCheckOther.cboType.ListIndex = i
        End If
    Next i
    frmCheckOther.txtValue.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 3)
    frmCheckOther.txtUnit.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 4)
    frmCheckOther.txtPurge.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 5)
    frmCheckOther.txtSum.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 6)
    frmCheckOther.txtMonth.Text = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 7)
    frmCheckOther.dtpProduce.Value = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 8)
    For i = 0 To frmCheckOther.cboProvince.ListCount - 1
        If frmCheckOther.cboProvince.List(i) = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 9) Then
            frmCheckOther.cboProvince.ListIndex = i
        End If
    Next i
    For i = 0 To frmCheckOther.cboFactory.ListCount - 1
        If frmCheckOther.cboFactory.List(i) = Me.MSFlexGrid1.TextMatrix(Me.MSFlexGrid1.Row, 10) Then
            frmCheckOther.cboFactory.ListIndex = i
        End If
    Next i
End If
End Sub

⌨️ 快捷键说明

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