main_kcgl_kccx.frm

来自「完整的物资管理系统源码」· FRM 代码 · 共 422 行

FRM
422
字号
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form main_kcgl_kccx 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Form1"
   ClientHeight    =   4905
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   11520
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4905
   ScaleWidth      =   11520
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdEnd 
      Caption         =   "退出"
      Height          =   390
      Left            =   9645
      TabIndex        =   11
      Top             =   4395
      Width           =   1740
   End
   Begin VB.CommandButton cmdFind 
      Caption         =   "查询"
      Height          =   390
      Left            =   7740
      TabIndex        =   3
      Top             =   4395
      Width           =   1740
   End
   Begin VB.Frame Frame1 
      Height          =   645
      Left            =   15
      TabIndex        =   1
      Top             =   0
      Width           =   11490
      Begin VB.TextBox Text1 
         BackColor       =   &H80000018&
         Height          =   315
         Index           =   3
         Left            =   9000
         TabIndex        =   9
         Top             =   195
         Width           =   2175
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H80000018&
         Height          =   315
         Index           =   2
         Left            =   6840
         TabIndex        =   8
         Top             =   195
         Width           =   1605
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H80000018&
         Height          =   315
         Index           =   1
         Left            =   3015
         TabIndex        =   6
         Top             =   195
         Width           =   2970
      End
      Begin VB.TextBox Text1 
         BackColor       =   &H80000018&
         Height          =   315
         Index           =   0
         Left            =   1050
         TabIndex        =   4
         Top             =   195
         Width           =   1110
      End
      Begin VB.Label Label1 
         Caption         =   "类别"
         Height          =   210
         Index           =   5
         Left            =   8535
         TabIndex        =   10
         Top             =   240
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "规格型号"
         Height          =   210
         Index           =   2
         Left            =   6060
         TabIndex        =   7
         Top             =   270
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "物资名称"
         Height          =   210
         Index           =   1
         Left            =   2235
         TabIndex        =   5
         Top             =   255
         Width           =   735
      End
      Begin VB.Label Label1 
         Caption         =   "物资编号"
         Height          =   210
         Index           =   0
         Left            =   285
         TabIndex        =   2
         Top             =   255
         Width           =   735
      End
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   345
      Left            =   -885
      Top             =   2505
      Visible         =   0   'False
      Width           =   2115
      _ExtentX        =   3731
      _ExtentY        =   609
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   1
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=mr_material"
      OLEDBString     =   "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=mr_material"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "select * from tb_kc"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin MSDataGridLib.DataGrid DataGrid1 
      Bindings        =   "main_kcgl_kccx.frx":0000
      Height          =   3600
      Left            =   15
      TabIndex        =   0
      Top             =   660
      Width           =   11475
      _ExtentX        =   20241
      _ExtentY        =   6350
      _Version        =   393216
      AllowUpdate     =   0   'False
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   10
      BeginProperty Column00 
         DataField       =   "类别"
         Caption         =   "类别"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   "物资编号"
         Caption         =   "物资编号"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02 
         DataField       =   "物资名称"
         Caption         =   "物资名称"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column03 
         DataField       =   "规格型号"
         Caption         =   "规格型号"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column04 
         DataField       =   "计量单位"
         Caption         =   "计量单位"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column05 
         DataField       =   "材质"
         Caption         =   "材质"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column06 
         DataField       =   "数量"
         Caption         =   "数量"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column07 
         DataField       =   "单价"
         Caption         =   "单价"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column08 
         DataField       =   "金额"
         Caption         =   "金额"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column09 
         DataField       =   "仓库"
         Caption         =   "仓库"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   2052
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
            ColumnWidth     =   734.74
         EndProperty
         BeginProperty Column01 
            ColumnWidth     =   854.929
         EndProperty
         BeginProperty Column02 
            ColumnWidth     =   2085.166
         EndProperty
         BeginProperty Column03 
            ColumnWidth     =   1049.953
         EndProperty
         BeginProperty Column04 
            ColumnWidth     =   810.142
         EndProperty
         BeginProperty Column05 
            ColumnWidth     =   689.953
         EndProperty
         BeginProperty Column06 
            ColumnWidth     =   524.976
         EndProperty
         BeginProperty Column07 
            ColumnWidth     =   1260.284
         EndProperty
         BeginProperty Column08 
            ColumnWidth     =   1184.882
         EndProperty
         BeginProperty Column09 
            ColumnWidth     =   1604.976
         EndProperty
      EndProperty
   End
End
Attribute VB_Name = "main_kcgl_kccx"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public selectsql As String

Private Sub cmdEnd_Click()
  Unload Me
End Sub

Private Sub cmdFind_Click()
   selectsql = ""
   If text1(0) <> "" Then
     If selectsql <> "" Then
       selectsql = "物资编号 like +'" + text1(0) + "'+'%'and " & selectsql
     Else
       selectsql = "物资编号 like +'" + text1(0) + "'+'%'"
     End If
   End If
   If text1(1) <> "" Then
     If selectsql <> "" Then
       selectsql = "物资名称 like+ '" + text1(1) + "'+'%'and " & selectsql
     Else
       selectsql = "物资名称 like + '" + text1(1) + "'+'%'"
     End If
   End If
   If text1(2) <> "" Then
     If selectsql <> "" Then
       selectsql = "规格型号 like+ '" + text1(2) + "'+'%'and " & selectsql
     Else
       selectsql = "规格型号 like+ '" + text1(2) + "'+'%'"
     End If
   End If
   If text1(3) <> "" Then
     If selectsql <> "" Then
       selectsql = "类别 like +'" + text1(3) + "'+'%'and " & selectsql
     Else
       selectsql = "类别 like + '" + text1(3) + "'+'%'"
     End If
   End If
   If selectsql <> "" Then
       Adodc1.RecordSource = "select * from tb_kc where " & selectsql
       Adodc1.Refresh
   Else
      Adodc1.RecordSource = "select * from tb_kc"
      Adodc1.Refresh
   End If
End Sub
Private Sub Form_Load()
  Me.Caption = text
  cmdFind_Click
  Dim fld
  Dim f1 As StdDataFormat
  For Each fld In Adodc1.Recordset.Fields
     '如果字段类型为“货币”,则格式化该字段
     If fld.Type = 6 Then
        Set f1 = DataGrid1.Columns(fld.Name).DataFormat
        f1.Format = "##,##0.00"
     End If
  Next
  Set f1 = DataGrid1.Columns("金额").DataFormat
  f1.Format = "##,##0.00"
End Sub

⌨️ 快捷键说明

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