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

📄 frmaddresssearch.frm

📁 Online Telephone Directory in Visual Basic
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form7 
   BackColor       =   &H00FFFFFF&
   BorderStyle     =   0  'None
   Caption         =   "Form7"
   ClientHeight    =   3195
   ClientLeft      =   0
   ClientTop       =   -105
   ClientWidth     =   4680
   LinkTopic       =   "Form7"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.Frame Frame2 
      BackColor       =   &H00C0E0FF&
      Caption         =   "Search Result"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   4575
      Left            =   240
      TabIndex        =   11
      Top             =   5760
      Visible         =   0   'False
      Width           =   14775
      Begin VB.Label Label12 
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00008000&
         Height          =   3735
         Left            =   12600
         TabIndex        =   17
         Top             =   720
         Width           =   1935
         WordWrap        =   -1  'True
      End
      Begin VB.Label Label11 
         BackColor       =   &H00FFFFFF&
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   3735
         Left            =   3120
         TabIndex        =   16
         Top             =   720
         Width           =   9375
         WordWrap        =   -1  'True
      End
      Begin VB.Label Label9 
         BackColor       =   &H000000FF&
         Caption         =   "Phone"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   255
         Left            =   12600
         TabIndex        =   15
         Top             =   360
         Width           =   1935
      End
      Begin VB.Label Label8 
         BackColor       =   &H000000FF&
         Caption         =   "Name && Address"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FFFFFF&
         Height          =   255
         Left            =   3120
         TabIndex        =   14
         Top             =   360
         Width           =   9375
      End
      Begin VB.Image Image2 
         Height          =   2730
         Left            =   120
         Picture         =   "FrmAddressSearch.frx":0000
         Stretch         =   -1  'True
         Top             =   840
         Width           =   2820
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00C0C0FF&
      ForeColor       =   &H00000000&
      Height          =   3735
      Left            =   5280
      TabIndex        =   0
      Top             =   1680
      Width           =   9855
      Begin VB.CommandButton Command2 
         BackColor       =   &H00C0FFFF&
         Caption         =   "Reset"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   4080
         Picture         =   "FrmAddressSearch.frx":1FFF2
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   2880
         Width           =   1935
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00C0FFFF&
         Caption         =   "Search"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   1920
         Picture         =   "FrmAddressSearch.frx":49C04
         Style           =   1  'Graphical
         TabIndex        =   5
         Top             =   2880
         Width           =   1935
      End
      Begin VB.CommandButton Command3 
         BackColor       =   &H00C0FFFF&
         Caption         =   "Home"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   6240
         Picture         =   "FrmAddressSearch.frx":73816
         Style           =   1  'Graphical
         TabIndex        =   4
         Top             =   2880
         Width           =   1935
      End
      Begin VB.TextBox Text1 
         Height          =   375
         Left            =   5520
         TabIndex        =   3
         Top             =   1440
         Width           =   2775
      End
      Begin VB.OptionButton Option2 
         BackColor       =   &H00C0C0FF&
         Caption         =   "Phone Number"
         Height          =   255
         Left            =   4080
         TabIndex        =   2
         Top             =   720
         Width           =   1695
      End
      Begin VB.OptionButton Option1 
         BackColor       =   &H00C0C0FF&
         Caption         =   "Name"
         Height          =   255
         Left            =   2400
         TabIndex        =   1
         Top             =   720
         Value           =   -1  'True
         Width           =   1215
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "( Do not put Zero  Before the State Code )"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   210
         Left            =   4320
         TabIndex        =   10
         Top             =   2040
         Width           =   3030
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Enter Name or Phone Number :"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   2640
         TabIndex        =   9
         Top             =   1440
         Width           =   2730
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Search By : "
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   240
         Left            =   1080
         TabIndex        =   8
         Top             =   720
         Width           =   1155
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "View All Subscriber Details"
         BeginProperty Font 
            Name            =   "Arial"
            Size            =   9.75
            Charset         =   0
            Weight          =   400
            Underline       =   -1  'True
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00C000C0&
         Height          =   240
         Left            =   6960
         MouseIcon       =   "FrmAddressSearch.frx":9D428
         MousePointer    =   99  'Custom
         TabIndex        =   7
         Top             =   240
         Width           =   2355
      End
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      AutoSize        =   -1  'True
      BackColor       =   &H00000000&
      Caption         =   "Address Search"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   20.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00C0C0FF&
      Height          =   570
      Left            =   5400
      TabIndex        =   13
      Top             =   960
      Width           =   9600
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Grahambell Telephone Directory"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   26.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   750
      Left            =   5280
      TabIndex        =   12
      Top             =   120
      Width           =   9720
   End
   Begin VB.Image Image1 
      Height          =   5430
      Left            =   0
      Picture         =   "FrmAddressSearch.frx":9D732
      Top             =   0
      Width           =   5130
   End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database, rs As Recordset
Private Sub Command1_Click()
Label11.Caption = ""
Label12.Caption = ""
If Option2.Value = True And Text1.Text <> "" Then
Set rs = db.OpenRecordset("Select * from Subscriber where Phone = '" & Text1.Text & "'")
    If rs.RecordCount <> 0 Then
    Frame2.Visible = True
    Label11.Caption = rs(0) & ", " & rs(1)
    Label12.Caption = rs(2)
    Else
    Frame2.Visible = False
    MsgBox "Please type the correct Phone Number ", vbInformation
    End If
ElseIf Option1.Value = True And Text1.Text <> "" Then
Set rs = db.OpenRecordset("Select * from Subscriber where Name Like '" & StrConv(Trim(Text1.Text), vbProperCase) & "*'")

    If rs.RecordCount <> 0 Then
    rs.MoveLast
    Frame2.Visible = True
    rs.MoveFirst
    While rs.EOF <> True
    Label11.Caption = Label11.Caption & rs(0) & ", " & rs(1) & vbCrLf
    Label12.Caption = Label12.Caption & rs(2) & vbCrLf
    Label11.Caption = StrConv(Label11.Caption, vbProperCase)
    rs.MoveNext
    Wend
    Else
    Frame2.Visible = False
    MsgBox "Please type the correct Name", vbInformation
    End If
Else
MsgBox "Enter Country Name or ISD Code", vbInformation
End If

End Sub

Private Sub Command2_Click()
Option1.Value = True
Text1.Text = ""
Frame2.Visible = False
End Sub

Private Sub Command3_Click()
Unload Me
Form1.Show
End Sub

Private Sub Form_Load()
Set db = OpenDatabase(App.Path & "\Database\DirDB.mdb")

End Sub

Private Sub Label3_Click()
Unload Me
Form12.Show
End Sub


⌨️ 快捷键说明

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