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

📄 frmfind.frm

📁 Address Book implemented in VB 6,can be use for storing person information
💻 FRM
📖 第 1 页 / 共 2 页
字号:
               BeginProperty Font 
                  Name            =   "La Bamba LET"
                  Size            =   12
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00000080&
               Height          =   375
               Left            =   2160
               TabIndex        =   22
               Top             =   840
               Width           =   3135
            End
            Begin VB.Label Label4 
               Alignment       =   2  'Center
               BackStyle       =   0  'Transparent
               Caption         =   "Copyright April 2005"
               BeginProperty Font 
                  Name            =   "La Bamba LET"
                  Size            =   12
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00000080&
               Height          =   375
               Left            =   2520
               TabIndex        =   21
               Top             =   480
               Width           =   2415
            End
         End
         Begin VB.Frame Frame2 
            Height          =   1095
            Left            =   120
            TabIndex        =   11
            Top             =   3360
            Width           =   6495
            Begin VB.ComboBox cmbField 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   11.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   375
               ItemData        =   "frmFind.frx":0483
               Left            =   120
               List            =   "frmFind.frx":0490
               TabIndex        =   2
               Text            =   "lastname"
               Top             =   600
               Width           =   2295
            End
            Begin VB.ComboBox cmbSort 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   11.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   375
               ItemData        =   "frmFind.frx":04B3
               Left            =   2520
               List            =   "frmFind.frx":04BD
               TabIndex        =   3
               Text            =   "ASC"
               Top             =   600
               Width           =   1935
            End
            Begin VB.TextBox txtvalue 
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   11.25
                  Charset         =   0
                  Weight          =   400
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               Height          =   375
               Left            =   4560
               TabIndex        =   1
               Top             =   600
               Width           =   1815
            End
            Begin VB.Label Label3 
               Caption         =   "Sort Order"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FF0000&
               Height          =   255
               Left            =   3000
               TabIndex        =   15
               Top             =   240
               Width           =   975
            End
            Begin VB.Label Label2 
               Caption         =   "Search for?"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FF0000&
               Height          =   255
               Left            =   5040
               TabIndex        =   14
               Top             =   240
               Width           =   1095
            End
            Begin VB.Label Label1 
               Alignment       =   2  'Center
               Caption         =   "Fieldnames"
               BeginProperty Font 
                  Name            =   "Arial"
                  Size            =   8.25
                  Charset         =   0
                  Weight          =   700
                  Underline       =   0   'False
                  Italic          =   0   'False
                  Strikethrough   =   0   'False
               EndProperty
               ForeColor       =   &H00FF0000&
               Height          =   255
               Left            =   600
               TabIndex        =   13
               Top             =   240
               Width           =   1095
            End
         End
         Begin VB.Label Label8 
            Alignment       =   2  'Center
            BackStyle       =   0  'Transparent
            Caption         =   "Program by Jessie Panerio of Philippines All Rights Reserved"
            BeginProperty Font 
               Name            =   "Arial"
               Size            =   12
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000080&
            Height          =   975
            Left            =   3240
            TabIndex        =   25
            Top             =   1920
            Width           =   3255
         End
      End
      Begin VB.Label Label7 
         Alignment       =   2  'Center
         BackStyle       =   0  'Transparent
         Caption         =   "Program by Jessie Panerio of Philippines All Rights Reserved"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00000080&
         Height          =   855
         Left            =   2760
         TabIndex        =   24
         Top             =   2760
         Width           =   3255
      End
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Program by Jessie Panerio of Philippines All Rights Reserved"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000080&
      Height          =   855
      Left            =   2880
      TabIndex        =   23
      Top             =   2280
      Width           =   3255
   End
End
Attribute VB_Name = "frmFind"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Form_Load()
     
     findmode = True
     infomode = False
     If adoview.BOF = True And adoview.EOF = True Then
        MsgBox "Empty Database", vbInformation, "Address Book"
        Exit Sub
     Else
        adoview.Close
        Call rs_view
        adoview.MoveFirst
        Call LoadImage
        Set frmFind.DataGrid1.DataSource = adoview
        Call recordcount
     End If
     Set frmFind.DataGrid1.DataSource = adoview

End Sub

Private Sub cmbField_Click()
     
     Call sort
     Call LoadImage
     txtvalue.Text = ""
     
End Sub

Private Sub cmbField_KeyPress(KeyAscii As Integer)
   
     Dim strvalid
     strvalid = ""
     If KeyAscii > 26 Then
        If InStr(strvalid, Chr(KeyAscii)) = 0 Then
           KeyAscii = 0
        End If
     End If

End Sub

Private Sub cmbSort_Click()
     
     Call sort
     Call LoadImage
     txtvalue.Text = ""

End Sub

Private Sub txtvalue_KeyPress(KeyAscii As Integer)
   
     If KeyAscii = 13 Then
        Call search
     End If
     KeyAscii = Asc(UCase(Chr(KeyAscii)))
     If Not ((KeyAscii >= 65 And KeyAscii <= 90) Or KeyAscii = 8) Then KeyAscii = 0
          
End Sub

Private Sub cmbSort_KeyPress(KeyAscii As Integer)
  
     Dim strvalid
     strvalid = ""
     If KeyAscii > 26 Then
        If InStr(strvalid, Chr(KeyAscii)) = 0 Then
           KeyAscii = 0
        End If
     End If

End Sub

Private Sub cmdClose_Click()
     
     infomode = True
     findmode = False
     frmPersonalInfo.imgpic.Picture = frmFind.imgpic.Picture
     Load frmPersonalInfo
     frmPersonalInfo.Show
     Call LoadImage
     Unload Me
  
End Sub

Private Sub txtvalue_Change()
  
     search
     
End Sub

Private Sub search()

     adoview.Find (" " & frmFind.cmbField.Text & " = '" & frmFind.txtvalue.Text & "'")
     Set frmFind.DataGrid1.DataSource = adoview
     Call recordcount
     If adoview.AbsolutePosition = -1 Then
        MsgBox "No file found", vbInformation, "Address Book"
        txtvalue.Text = ""
        txtvalue.SetFocus
        Call LoadImage
     Else
        Call LoadImage
     End If
    
End Sub

Private Sub sort()

     On Error Resume Next
     Dim SQLTEXT As String
     adoview.Close
     SQLTEXT = "SELECT * FROM addressbook ORDER BY" + " " & frmFind.cmbField.Text + " " & frmFind.cmbSort.Text
     adoview.Open SQLTEXT, cnn, adOpenStatic, adLockPessimistic
     Set frmFind.DataGrid1.DataSource = adoview
     
End Sub
      
Private Sub recordcount()
   
     lblrecno.Caption = " Record   " & adoview.AbsolutePosition & "  of   " & adoview.recordcount
  
End Sub

Private Sub lvbutton7MoveFirst_Click()
  
     If adoview.recordcount <= 1 Then Exit Sub
       txtvalue.Text = ""
       adoview.MoveFirst
       Call recordcount
       Call LoadImage
      
End Sub

Private Sub lvbutton8Previous_Click()
  
     If adoview.AbsolutePosition <= 1 Then Exit Sub
       txtvalue.Text = ""
       adoview.MovePrevious
       Call recordcount
       Call LoadImage
       
End Sub

Private Sub lvbutton9Next_Click()
    
     If adoview.AbsolutePosition >= adoview.recordcount Or adoview.recordcount <= 1 Then Exit Sub
       txtvalue.Text = ""
       adoview.MoveNext
       Call recordcount
       Call LoadImage
       
End Sub

Private Sub lvbutton10MoveLast_Click()
     
     If adoview.recordcount <= 1 Then Exit Sub
       txtvalue.Text = ""
       adoview.MoveLast
       recordcount
       Call LoadImage
       
End Sub

⌨️ 快捷键说明

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