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

📄 frmcustomer.frm

📁 一个OA办公自动化管理系统
💻 FRM
字号:
VERSION 5.00
Object = "{0D6234D1-DBA2-11D1-B5DF-0060976089D0}#6.0#0"; "TODG6.OCX"
Begin VB.Form frmCustomer 
   Caption         =   "客户查找"
   ClientHeight    =   4845
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6960
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4845
   ScaleWidth      =   6960
   StartUpPosition =   1  '所有者中心
   Begin VB.TextBox txtName 
      Height          =   375
      Left            =   1140
      TabIndex        =   6
      Top             =   120
      Width           =   1935
   End
   Begin VB.TextBox txtID 
      Height          =   375
      Left            =   1140
      TabIndex        =   5
      Top             =   720
      Width           =   1935
   End
   Begin VB.TextBox txtType 
      Height          =   375
      Left            =   4500
      TabIndex        =   4
      Top             =   720
      Width           =   1935
   End
   Begin VB.CommandButton cmdOk 
      Caption         =   "确定"
      Height          =   375
      Left            =   3660
      TabIndex        =   3
      Top             =   120
      Width           =   735
   End
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消"
      Height          =   375
      Left            =   4680
      TabIndex        =   2
      Top             =   120
      Width           =   735
   End
   Begin VB.CommandButton cmdClear 
      Caption         =   "刷新"
      Height          =   375
      Left            =   5700
      TabIndex        =   1
      Top             =   120
      Width           =   735
   End
   Begin TrueOleDBGrid60.TDBGrid TDBGrid1 
      Height          =   3375
      Left            =   180
      OleObjectBlob   =   "frmCustomer.frx":0000
      TabIndex        =   0
      Top             =   1260
      Width           =   6555
   End
   Begin VB.Label Label1 
      Caption         =   "名 称"
      Height          =   255
      Left            =   300
      TabIndex        =   9
      Top             =   180
      Width           =   735
   End
   Begin VB.Label Label2 
      Caption         =   "编 号"
      Height          =   255
      Left            =   300
      TabIndex        =   8
      Top             =   720
      Width           =   735
   End
   Begin VB.Label Label3 
      Caption         =   "类 型"
      Height          =   255
      Left            =   3720
      TabIndex        =   7
      Top             =   780
      Width           =   615
   End
End
Attribute VB_Name = "frmCustomer"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim rs As New ADODB.Recordset
Dim sql As String
Dim VarField As String
Dim StrSql As String
Dim Grid
Public cusType As String, Parent As Form

Private Sub CmdCancel_Click()
    Me.Parent.ReturnCusName = ""
  
    Unload Me
End Sub

Private Sub cmdClear_Click()
  
  txtID.Text = ""
  txtName.Text = ""
  txtType.Text = ""
  InitForm
  
End Sub

Private Sub CmdOk_Click()
    Me.Parent.ReturnCusName = Me.TDBGrid1.Columns("客户名称").Value
    Unload Me
End Sub

Private Sub InitForm()
  
  StrSql = ""
  If rs.State = 1 Then
     rs.Close
  End If
  
  StrSql = "select contactNum 编号,contactName 客户名称,客户类型=(select A.description from mis_customer_type A where A.id=mis_customer.type ) from mis_customer"
  
  rs.Open StrSql, GetCNClient(), adOpenDynamic, adLockOptimistic
  
  Set TDBGrid1.DataSource = rs
  TDBGrid1.Refresh
  
End Sub

Private Sub Form_Load()
   InitForm
End Sub

Private Sub ChangeTDBGrid()
  

  sql = "contactNum like '%" & Trim(txtID.Text) & "%'" & " and " & " type in (select ID from mis_customer_type  where description like '%" & Trim(txtType.Text) & "%' ) " & " and " & "contactName like '%" & Trim(txtName.Text) & "%' "
  
  If sql = "" Then
    StrSql = "select contactNum 编号,contactName 客户名称,客户类型=(select A.description from mis_customer_type A where A.id=mis_customer.type ) from mis_customer "
  Else
    StrSql = "select contactNum 编号,contactName 客户名称,客户类型=(select A.description from mis_customer_type A where A.id=mis_customer.type ) from mis_customer where "
  End If
  
  StrSql = StrSql & sql
  
  rs.Open StrSql, GetCNClient(), adOpenDynamic, adLockOptimistic
  
  Set TDBGrid1.DataSource = rs
  TDBGrid1.Refresh

  
End Sub


Private Sub txtID_Change()
   changeForm
End Sub

Private Sub txtName_Change()
   changeForm
End Sub



Private Sub changeForm()
  If rs.State = 1 Then
     rs.Close
     ChangeTDBGrid
  End If
  If rs.State = 0 Then
     ChangeTDBGrid
  End If
End Sub

Private Sub txtType_Change()
  changeForm
End Sub

⌨️ 快捷键说明

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