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

📄 guestfind.frm

📁 一套VB完整的灯具销售管理系统设计
💻 FRM
字号:
VERSION 5.00
Begin VB.Form GuestFind 
   BackColor       =   &H00808000&
   BorderStyle     =   3  'Fixed Dialog
   ClientHeight    =   4050
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6495
   FillColor       =   &H000080FF&
   Icon            =   "GuestFind.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4050
   ScaleWidth      =   6495
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.OptionButton Option2 
      BackColor       =   &H00808000&
      Caption         =   "或"
      Height          =   255
      Left            =   5520
      TabIndex        =   15
      Top             =   2370
      Width           =   615
   End
   Begin VB.OptionButton Option1 
      BackColor       =   &H00808000&
      Caption         =   "和"
      Height          =   240
      Left            =   5505
      TabIndex        =   14
      Top             =   2025
      Width           =   555
   End
   Begin VB.CommandButton Addif 
      Caption         =   "添加条件"
      Enabled         =   0   'False
      Height          =   375
      Left            =   5385
      TabIndex        =   12
      Top             =   3270
      Width           =   915
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H00808000&
      Caption         =   "多项查询条件"
      ForeColor       =   &H00C00000&
      Height          =   990
      Left            =   195
      TabIndex        =   8
      Top             =   1740
      Width           =   5085
      Begin VB.TextBox Text3 
         Height          =   300
         Left            =   2940
         TabIndex        =   11
         Top             =   450
         Width           =   1935
      End
      Begin VB.ComboBox Combo4 
         Height          =   300
         Left            =   1875
         Style           =   2  'Dropdown List
         TabIndex        =   10
         Top             =   450
         Width           =   930
      End
      Begin VB.ComboBox Combo3 
         Height          =   300
         Left            =   255
         Style           =   2  'Dropdown List
         TabIndex        =   9
         Top             =   450
         Width           =   1485
      End
   End
   Begin VB.CommandButton Restore 
      Caption         =   "低级"
      Height          =   375
      Left            =   4350
      TabIndex        =   7
      Top             =   3270
      Width           =   915
   End
   Begin VB.CommandButton Advance 
      Caption         =   "高级"
      Height          =   375
      Left            =   5400
      TabIndex        =   4
      Top             =   975
      Width           =   915
   End
   Begin VB.CommandButton Closeform 
      Cancel          =   -1  'True
      Caption         =   "放弃"
      Height          =   375
      Left            =   5400
      TabIndex        =   3
      Top             =   585
      Width           =   915
   End
   Begin VB.CommandButton Sure 
      Caption         =   "查找"
      Enabled         =   0   'False
      Height          =   375
      Left            =   5400
      TabIndex        =   2
      Top             =   195
      Width           =   915
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00808000&
      Caption         =   "单项查询"
      ForeColor       =   &H000000C0&
      Height          =   960
      Left            =   210
      TabIndex        =   0
      Top             =   195
      Width           =   5010
      Begin VB.ComboBox Combo2 
         Height          =   300
         Left            =   225
         Style           =   2  'Dropdown List
         TabIndex        =   6
         Top             =   405
         Width           =   1530
      End
      Begin VB.ComboBox Combo1 
         Height          =   300
         Left            =   1875
         Style           =   2  'Dropdown List
         TabIndex        =   5
         Top             =   405
         Width           =   840
      End
      Begin VB.TextBox Text1 
         Height          =   330
         Left            =   2865
         TabIndex        =   1
         Top             =   390
         Width           =   1905
      End
   End
   Begin VB.Label Iflist 
      BackColor       =   &H00C0E0FF&
      BorderStyle     =   1  'Fixed Single
      Height          =   735
      Left            =   225
      TabIndex        =   16
      Top             =   3165
      Width           =   3900
      WordWrap        =   -1  'True
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "综合条件列表"
      ForeColor       =   &H0000C0C0&
      Height          =   180
      Left            =   1710
      TabIndex        =   13
      Top             =   2880
      Width           =   1080
   End
   Begin VB.Line Line2 
      BorderColor     =   &H00FFFFFF&
      X1              =   90
      X2              =   6375
      Y1              =   1560
      Y2              =   1560
   End
   Begin VB.Line Line1 
      X1              =   90
      X2              =   6360
      Y1              =   1530
      Y2              =   1530
   End
End
Attribute VB_Name = "GuestFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Addif_Click()
Dim TempStr As String
Select Case Combo4.Text
   Case "等于"
      Select Case Combo3.Text
           Case "姓名"
             TempStr = "姓名='" & Trim(Text3.Text) & "'"
           Case "单位名称"
             TempStr = "单位名称='" & Trim(Text3.Text) & "'"
           Case "单位地址"
             TempStr = "单位地址='" & Trim(Text3.Text) & "'"
           Case "联系电话"
             TempStr = "联系电话='" & Trim(Text3.Text) & "'"
           Case "传真"
            TempStr = "传真='" & Trim(Text3.Text) & "'"
           Case "手机"
             TempStr = "手机='" & Trim(Text3.Text) & "'"
           Case "传呼"
             TempStr = "传呼='" & Trim(Text3.Text) & "'"
               End Select
  Case "包含"
      Select Case Combo3.Text
           Case "姓名"
             TempStr = "姓名 Like '*" & Trim(Text3.Text) & "*'"
           Case "单位名称"
             TempStr = "单位名称 Like '*" & Trim(Text3.Text) & "*'"
           Case "单位地址"
             TempStr = "单位地址 Like '*" & Trim(Text3.Text) & "*'"
           Case "联系电话"
             TempStr = "联系电话 Like '*" & Trim(Text3.Text) & "*'"
           Case "传真"
             TempStr = "传真 Like '*" & Trim(Text3.Text) & "*'"
           Case "手机"
             TempStr = "手机 Like '*" & Trim(Text3.Text) & "*'"
           Case "传呼"
             TempStr = "传呼 Like '*" & Trim(Text3.Text) & "*'"
               End Select
    End Select
If Trim(Iflist.Caption) = "" Then
   Iflist.Caption = TempStr
   ElseIf Option1.Value = True Then
       Iflist.Caption = Iflist.Caption & " AND " & TempStr
        Else
        Iflist.Caption = Iflist.Caption & " OR " & TempStr
         End If
 PublicFindstr = Iflist.Caption
End Sub

Private Sub Advance_Click()
Advance.Enabled = False
GuestFind.Height = 4485
End Sub

Private Sub CloseForm_Click()
Unload Me
End Sub

Private Sub Combo2_Click()
Text1.Text = ""
End Sub

Private Sub Combo3_Click()
Text3.Text = ""
End Sub

Private Sub Form_Load()
'定义小窗口
GuestFind.Height = 1875
'初始化四个列表框
Combo1.AddItem "等于", 0
Combo1.AddItem "包含", 1
Combo1.ListIndex = 0
Combo2.AddItem "姓名", 0
Combo2.AddItem "单位名称", 1
Combo2.AddItem "单位地址", 2
Combo2.AddItem "联系电话", 3
Combo2.AddItem "传真", 4
Combo2.AddItem "手机", 5
Combo2.AddItem "传呼", 6
Combo2.ListIndex = 0
Combo4.AddItem "等于", 0
Combo4.AddItem "包含", 1
Combo4.ListIndex = 0
Combo3.AddItem "姓名", 0
Combo3.AddItem "单位名称", 1
Combo3.AddItem "单位地址", 2
Combo3.AddItem "联系电话", 3
Combo3.AddItem "传真", 4
Combo3.AddItem "手机", 5
Combo3.AddItem "传呼", 6
Combo3.ListIndex = 0
Option1.Value = True
GuestFind.Left = (Screen.Width - GuestFind.Width) / 2
GuestFind.Top = (Screen.Height - GuestFind.Height) / 4
End Sub

Private Sub Iflist_Change()
If Trim(Iflist.Caption) = "" And Trim(Text1.Text) = "" Then
  Sure.Enabled = False
 Else
  Sure.Enabled = True
End If
End Sub

Private Sub Restore_Click()
GuestFind.Height = 1875
Advance.Enabled = True
'GuestFind.Left = (Screen.Width - GuestFind.Width) / 2
'GuestFind.Top = (Screen.Height - GuestFind.Height) / 2
End Sub

Private Sub Sure_Click()
If Advance.Enabled = True Then
 Select Case Combo1.Text
   Case "等于"
      Select Case Combo2.Text
           Case "姓名"
             PublicFindstr = "姓名='" & Trim(Text1.Text) & "'"
           Case "单位名称"
             PublicFindstr = "单位名称='" & Trim(Text1.Text) & "'"
           Case "单位地址"
             PublicFindstr = "单位地址='" & Trim(Text1.Text) & "'"
           Case "联系电话"
             PublicFindstr = "联系电话='" & Trim(Text1.Text) & "'"
           Case "传真"
             PublicFindstr = "传真='" & Trim(Text1.Text) & "'"
           Case "手机"
             PublicFindstr = "手机='" & Trim(Text1.Text) & "'"
           Case "传呼"
             PublicFindstr = "传呼='" & Trim(Text1.Text) & "'"
               End Select
  Case "包含"
      Select Case Combo2.Text
           Case "姓名"
             PublicFindstr = "姓名 Like '*" & Trim(Text1.Text) & "*'"
           Case "单位名称"
             PublicFindstr = "单位名称 Like '*" & Trim(Text1.Text) & "*'"
           Case "单位地址"
             PublicFindstr = "单位地址 Like '*" & Trim(Text1.Text) & "*'"
           Case "联系电话"
             PublicFindstr = "联系电话 Like '*" & Trim(Text1.Text) & "*'"
           Case "传真"
             PublicFindstr = "传真 Like '*" & Trim(Text1.Text) & "*'"
           Case "手机"
             PublicFindstr = "手机 Like '*" & Trim(Text1.Text) & "*'"
           Case "传呼"
             PublicFindstr = "传呼 Like '*" & Trim(Text1.Text) & "*'"
               End Select
    End Select
End If
'高级查找经过以下
 '如果客户发票查询中调用此面板
 If FindGuest = False Then
       '查找记录
      guest.Data1.Recordset.FindFirst PublicFindstr
        If guest.Data1.Recordset.NoMatch Then
             MsgBox "没有查找到此客户", vbOKOnly + 48, "查找客户"
              '查找下一个为假
             guest.Nextfind.Enabled = False
             Iflist.Caption = ""
               Exit Sub
            End If
           guest.Nextfind.Enabled = True
         Unload Me
        Exit Sub
    Else
       '查找记录
        GuestGHuo.Data1.Recordset.FindFirst PublicFindstr
          If GuestGHuo.Data1.Recordset.NoMatch Then
             MsgBox "没有查找到此客户", vbOKOnly + 48, "查找客户"
             Exit Sub
                End If
                   If IsNull(GuestGHuo.Data1.Recordset.Fields(0)) Then
                       MsgBox "客户为空", vbOKOnly + 48, "查找客户"
                       Unload Me
                      Exit Sub
                    End If
                GuestGHuo.Text1.Text = GuestGHuo.Data1.Recordset.Fields(0)
                GuestGHuo.DBCombo1.Text = GuestGHuo.Text1.Text
            Unload Me
         Exit Sub
    End If
 
     
End Sub

Private Sub Text1_Change()
If Trim(Text1.Text) = "" And Trim(Iflist.Caption) = "" Then
Sure.Enabled = False
Else
Sure.Enabled = True
End If
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
   Sure.SetFocus
   End If
End Sub

Private Sub Text3_Change()
If Trim(Text3.Text) = "" Then
   Addif.Enabled = False
   Else
   Addif.Enabled = True
   End If
End Sub

⌨️ 快捷键说明

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