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

📄 frmdeviceinlist.frm

📁 网路设备资产管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form FrmDeviceRegisterList 
   Caption         =   "设备登记单列表"
   ClientHeight    =   7305
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   10320
   Icon            =   "FrmDeviceInList.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   7305
   ScaleWidth      =   10320
   StartUpPosition =   2  '屏幕中心
   Begin VB.Frame Frame1 
      Caption         =   "查询"
      Height          =   1815
      Left            =   120
      TabIndex        =   1
      Top             =   960
      Width           =   10095
      Begin VB.TextBox txtRegisterId 
         Height          =   375
         Left            =   1200
         TabIndex        =   13
         Top             =   240
         Width           =   2175
      End
      Begin VB.TextBox txtTransactor 
         Height          =   390
         Left            =   5760
         TabIndex        =   4
         Top             =   1200
         Width           =   2175
      End
      Begin VB.TextBox txtApplicant 
         Height          =   390
         Left            =   1200
         TabIndex        =   3
         Top             =   1200
         Width           =   2175
      End
      Begin VB.CommandButton cmdSearch 
         Caption         =   "查找"
         Height          =   375
         Left            =   8640
         TabIndex        =   2
         Top             =   1200
         Width           =   1215
      End
      Begin NetManager.YMDDate ymdDjrqStart 
         Height          =   375
         Left            =   1080
         TabIndex        =   5
         Top             =   720
         Width           =   3375
         _ExtentX        =   5953
         _ExtentY        =   661
      End
      Begin NetManager.YMDDate ymdDjrqEnd 
         Height          =   375
         Left            =   5640
         TabIndex        =   6
         Top             =   720
         Width           =   3375
         _ExtentX        =   5953
         _ExtentY        =   661
      End
      Begin VB.Label Label9 
         Caption         =   "日期从:"
         Height          =   255
         Left            =   240
         TabIndex        =   11
         Top             =   840
         Width           =   975
      End
      Begin VB.Label Label6 
         Caption         =   "经手人:"
         Height          =   255
         Left            =   4680
         TabIndex        =   10
         Top             =   1320
         Width           =   975
      End
      Begin VB.Label Label5 
         Caption         =   "申请人:"
         Height          =   255
         Left            =   240
         TabIndex        =   9
         Top             =   1320
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "流水号:"
         Height          =   255
         Left            =   240
         TabIndex        =   8
         Top             =   360
         Width           =   735
      End
      Begin VB.Label Label2 
         Caption         =   "至:"
         Height          =   255
         Left            =   4680
         TabIndex        =   7
         Top             =   840
         Width           =   615
      End
   End
   Begin MSComctlLib.Toolbar Toolbar1 
      Align           =   1  'Align Top
      Height          =   780
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   10320
      _ExtentX        =   18203
      _ExtentY        =   1376
      ButtonWidth     =   1773
      ButtonHeight    =   1376
      Style           =   1
      ImageList       =   "ImageList1"
      _Version        =   393216
      BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
         NumButtons      =   4
         BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "添加登记单"
            Key             =   "添加登记单"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "查看登记单"
            Key             =   "查看登记单"
            ImageIndex      =   2
         EndProperty
         BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Style           =   3
         EndProperty
         BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
            Caption         =   "关闭"
            Key             =   "关闭"
            ImageIndex      =   4
         EndProperty
      EndProperty
      Begin MSComctlLib.ImageList ImageList1 
         Left            =   8040
         Top             =   0
         _ExtentX        =   1005
         _ExtentY        =   1005
         BackColor       =   -2147483643
         ImageWidth      =   32
         ImageHeight     =   32
         MaskColor       =   12632256
         _Version        =   393216
         BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
            NumListImages   =   4
            BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "FrmDeviceInList.frx":08CA
               Key             =   ""
            EndProperty
            BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "FrmDeviceInList.frx":11A4
               Key             =   ""
            EndProperty
            BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "FrmDeviceInList.frx":1A7E
               Key             =   ""
            EndProperty
            BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
               Picture         =   "FrmDeviceInList.frx":2358
               Key             =   ""
            EndProperty
         EndProperty
      End
   End
   Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
      Height          =   4335
      Left            =   120
      TabIndex        =   12
      Top             =   2880
      Width           =   10095
      _ExtentX        =   17806
      _ExtentY        =   7646
      _Version        =   393216
      RowHeightMin    =   315
      WordWrap        =   -1  'True
      HighLight       =   0
      FillStyle       =   1
      AllowUserResizing=   1
   End
End
Attribute VB_Name = "FrmDeviceRegisterList"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/09/25
'描    述:江苏大学网络信息中心网络管理系统 - v1.0 Beta
'网    站:http://www.Mndsoft.com/  (VB6源码博客)
'网    站:http://www.VbDnet.com/   (VB.NET源码博客,主要基于.NET2005)
'e-mail  :Mndsoft@163.com
'e-mail  :Mndsoft@126.com
'OICQ    :88382850
'          如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************

Dim txtSQL As String
Dim MsgText As String
Dim HasError As Boolean

Dim searchQuery As String
Dim txtQuery As String

Private WithEvents mMSFlexGrid1 As cFlexGridBinder
Attribute mMSFlexGrid1.VB_VarHelpID = -1



Private Sub cmdSearch_Click()

txtQuery = " where register_id > 0 "
searchQuery = ""



  If Trim(txtRegisterId) <> "" Then
     searchQuery = searchQuery & " and register_id = '" & Trim(txtRegisterId) & "' "
  End If
  
  If Trim(ymdDjrqStart.FormatDate) <> "" And Trim(ymdDjrqEnd.FormatDate) <> "" Then
     searchQuery = searchQuery & " and djrq >= '" & Trim(ymdDjrqStart.FormatDate) & "' and djrq <= " & Trim(ymdDjrqEnd.FormatDate)
  End If
  
  If Trim(txtApplicant) <> "" Then
     searchQuery = searchQuery & " and applicant = '" & Trim(txtApplicant) & "' "
  End If
  
  If Trim(txtTransactor) <> "" Then
     searchQuery = searchQuery & " and transactor = '" & Trim(txtTransactor) & "' "
  End If

Grid_Fill

End Sub


Private Sub Form_Load()
Grid_Init
Grid_Fill
End Sub

Sub Grid_Init()

    With MSFlexGrid1
        .FormatString = "|<流水号|<日期|<内容|<申请人|<经办人"
        .ColWidth(0) = 0
        .ColWidth(1) = 1500
        .ColWidth(2) = 1500
        .ColWidth(3) = 3500
        .ColWidth(4) = 1500
        .ColWidth(5) = 1500

        .Rows = 1

    End With
    
    Set mMSFlexGrid1 = New cFlexGridBinder
    With mMSFlexGrid1
        Set .Grid = MSFlexGrid1
        
        .Editable = True
        .EditOnMouse = emeNone

        .FullRowSelect = True
        
    End With

End Sub

Sub Grid_Fill()

Dim rst As ADODB.Recordset
Set rst = New ADODB.Recordset
txtSQL = "select * from tbl_device_register " & txtQuery & searchQuery & " order by register_id desc"
Set rst = ExecuteSQL(txtSQL, MsgText, HasError)

   
   MSFlexGrid1.Rows = 1
    
    Do While Not rst.EOF
        MSFlexGrid1.AddItem vbTab _
        & rst.Fields("register_id") & vbTab _
        & rst.Fields("djrq") & vbTab _
        & rst.Fields("register_desc") & vbTab _
        & rst.Fields("applicant") & vbTab _
        & rst.Fields("transactor")
        
    rst.MoveNext
    Loop
    

End Sub



Private Sub MSFlexGrid1_DblClick()
          If mMSFlexGrid1.HighlightedRow > 0 Then
             FrmDeviceRegister.register_id = MSFlexGrid1.TextMatrix(mMSFlexGrid1.HighlightedRow, 1)
             FrmDeviceRegister.mode = "view"
             FrmDeviceRegister.Show
          Else
             MsgBox "必须选择一张登记单", vbOKOnly + vbExclamation, "警告"
          End If
End Sub

Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
    On Error Resume Next
    Select Case Button.key
    
        Case "添加登记单"
        
             FrmDeviceRegister.mode = "add"
             FrmDeviceRegister.Show

          
        Case "查看登记单"
          If mMSFlexGrid1.HighlightedRow > 0 Then
             FrmDeviceRegister.register_id = MSFlexGrid1.TextMatrix(mMSFlexGrid1.HighlightedRow, 1)
             FrmDeviceRegister.mode = "view"
             FrmDeviceRegister.Show
          Else
             MsgBox "必须选择一张登记单", vbOKOnly + vbExclamation, "警告"
          End If
          

        Case "关闭"
          Unload Me
          
    End Select
End Sub

⌨️ 快捷键说明

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