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

📄 frmaddress.frm

📁 Online Telephone Directory in Visual Basic
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form14 
   BackColor       =   &H00E0E0E0&
   BorderStyle     =   0  'None
   Caption         =   "Form14"
   ClientHeight    =   3195
   ClientLeft      =   0
   ClientTop       =   -105
   ClientWidth     =   4680
   LinkTopic       =   "Form14"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   WindowState     =   2  'Maximized
   Begin VB.TextBox Text3 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   9480
      TabIndex        =   18
      Top             =   6720
      Width           =   3615
   End
   Begin VB.Frame Frame2 
      BackColor       =   &H000000C0&
      Height          =   1575
      Left            =   7080
      TabIndex        =   10
      Top             =   2520
      Visible         =   0   'False
      Width           =   6135
      Begin VB.CommandButton Command8 
         Caption         =   "&Cancel"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3240
         TabIndex        =   12
         Top             =   600
         Width           =   1815
      End
      Begin VB.CommandButton Command6 
         Caption         =   "&Update"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   960
         TabIndex        =   11
         Top             =   600
         Width           =   1815
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H000000C0&
      Height          =   1575
      Left            =   7080
      TabIndex        =   3
      Top             =   2520
      Width           =   6135
      Begin VB.CommandButton Command1 
         Caption         =   "&Add"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   9
         Top             =   480
         Width           =   1815
      End
      Begin VB.CommandButton Command2 
         Caption         =   "&Edit"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   8
         Top             =   480
         Width           =   1815
      End
      Begin VB.CommandButton Command3 
         Caption         =   "&Delete"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3840
         TabIndex        =   7
         Top             =   480
         Width           =   1815
      End
      Begin VB.CommandButton Command4 
         Caption         =   "&Close"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   3840
         TabIndex        =   6
         Top             =   840
         Width           =   1815
      End
      Begin VB.CommandButton Command5 
         Caption         =   "&Sort"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   240
         TabIndex        =   5
         Top             =   840
         Width           =   1815
      End
      Begin VB.CommandButton Command7 
         Caption         =   "&Move"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2040
         TabIndex        =   4
         Top             =   840
         Width           =   1815
      End
   End
   Begin VB.HScrollBar HScroll1 
      Height          =   255
      Left            =   7080
      TabIndex        =   2
      Top             =   7200
      Value           =   1
      Width           =   5415
   End
   Begin VB.TextBox Text2 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   1575
      Left            =   9480
      MultiLine       =   -1  'True
      TabIndex        =   1
      Top             =   5040
      Width           =   3615
   End
   Begin VB.TextBox Text1 
      Appearance      =   0  'Flat
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   9480
      TabIndex        =   0
      Top             =   4320
      Width           =   3615
   End
   Begin VB.Label Label6 
      BackColor       =   &H00808080&
      Caption         =   "Phone Number"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   7200
      TabIndex        =   19
      Top             =   6720
      Width           =   2175
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Details"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   675
      Left            =   6600
      TabIndex        =   17
      Top             =   1080
      Width           =   1950
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Subscriber"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   675
      Left            =   6120
      TabIndex        =   16
      Top             =   480
      Width           =   2955
   End
   Begin VB.Image Image1 
      Height          =   5430
      Left            =   0
      Picture         =   "FrmAddress.frx":0000
      Top             =   2160
      Width           =   5130
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Label3"
      Height          =   195
      Left            =   12720
      TabIndex        =   15
      Top             =   7200
      Width           =   480
   End
   Begin VB.Label Label2 
      BackColor       =   &H00808080&
      Caption         =   "Address"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   7200
      TabIndex        =   14
      Top             =   5040
      Width           =   2175
   End
   Begin VB.Label Label1 
      BackColor       =   &H00808080&
      Caption         =   "Subscriber Name"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   7200
      TabIndex        =   13
      Top             =   4320
      Width           =   2175
   End
   Begin VB.Shape Shape2 
      BackColor       =   &H00000000&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00000000&
      Height          =   1935
      Left            =   5400
      Shape           =   2  'Oval
      Top             =   0
      Width           =   4215
   End
   Begin VB.Shape Shape1 
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00FFFFFF&
      Height          =   5415
      Left            =   0
      Top             =   2160
      Width           =   15015
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H00808080&
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00000000&
      Height          =   1935
      Left            =   5520
      Shape           =   2  'Oval
      Top             =   240
      Width           =   4215
   End
End
Attribute VB_Name = "Form14"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim db As Database, rs As Recordset, bt As Integer


Private Sub Command1_Click()
bt = 1
Frame1.Visible = False
Frame2.Visible = True
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Label3.Caption = "Add Record"
HScroll1.Visible = False
End Sub

Private Sub Command2_Click()
bt = 2
Frame1.Visible = False
Frame2.Visible = True
Label3.Caption = "Edit Record"
HScroll1.Visible = False

End Sub

Private Sub Command3_Click()
X = MsgBox("Are you confirm to delete?", vbYesNo + vbQuestion)
If X = vbYes Then
rs.Delete
MsgBox "Removed Successfully", vbCritical
Form_Load
End If
End Sub

Private Sub Command4_Click()
Unload Me
End Sub

Private Sub Command5_Click()
sr = InputBox("Enter the Column name to sort (Name or Address or Phone) : ")
If sr <> "Name" And sr <> "Address" And sr <> "Phone" Then
MsgBox "Invalid Column", vbCritical
Exit Sub
End If

Set rs = db.OpenRecordset("Select * from Subscriber order by " & sr)
rs.MoveFirst
disp

End Sub

Private Sub Command6_Click()

If bt = 1 Then
rs.AddNew
ElseIf bt = 2 Then
rs.Edit
End If
rs(0) = Text1.Text
rs(1) = Text2.Text
rs(2) = Text3.Text
rs.Update
Form_Load

End Sub

Private Sub Command7_Click()
X = InputBox("Enter number of rows to  move" & vbCrLf & " (Enter negative values for move back")
On Error Resume Next
HScroll1.Value = HScroll1.Value + X
End Sub

Private Sub Form_Load()

Set db = OpenDatabase(App.Path & "\Database\DirDB.mdb")
Set rs = db.OpenRecordset("Subscriber")

If rs.RecordCount <> 0 Then
HScroll1.Max = rs.RecordCount - 1
Label3.Caption = 1 & "/" & rs.RecordCount
rs.MoveFirst
disp
HScroll1.Value = 0

Frame2.Visible = False
Frame1.Visible = True
HScroll1.Visible = True
End If
End Sub

Private Sub HScroll1_Change()
rs.MoveFirst
rs.Move HScroll1.Value
Label3.Caption = HScroll1.Value + 1 & "/" & rs.RecordCount
disp
End Sub
Sub disp()
Text1.Text = rs(0)
Text2.Text = rs(1)
Text3.Text = rs(2)
End Sub


⌨️ 快捷键说明

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