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

📄 frmstd.frm

📁 Online Telephone Directory in Visual Basic
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form4 
   BackColor       =   &H00E0E0E0&
   BorderStyle     =   0  'None
   Caption         =   "S T D Details.."
   ClientHeight    =   7845
   ClientLeft      =   3030
   ClientTop       =   3120
   ClientWidth     =   13755
   LinkTopic       =   "Form4"
   ScaleHeight     =   7845
   ScaleWidth      =   13755
   ShowInTaskbar   =   0   'False
   WindowState     =   2  'Maximized
   Begin VB.Frame Frame2 
      BackColor       =   &H0000C0C0&
      Height          =   1575
      Left            =   6120
      TabIndex        =   15
      Top             =   2760
      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        =   17
         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        =   16
         Top             =   600
         Width           =   1815
      End
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H0000C0C0&
      Height          =   1575
      Left            =   6120
      TabIndex        =   6
      Top             =   2760
      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        =   12
         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        =   11
         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        =   10
         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        =   9
         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        =   8
         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        =   7
         Top             =   840
         Width           =   1815
      End
   End
   Begin VB.HScrollBar HScroll1 
      Height          =   255
      Left            =   6120
      TabIndex        =   4
      Top             =   6120
      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          =   375
      Left            =   8520
      TabIndex        =   3
      Top             =   5280
      Width           =   3015
   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            =   8520
      TabIndex        =   1
      Top             =   4560
      Width           =   3015
   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            =   7440
      TabIndex        =   14
      Top             =   840
      Width           =   1950
   End
   Begin VB.Shape Shape3 
      BackColor       =   &H00000000&
      BackStyle       =   1  'Opaque
      Height          =   1935
      Left            =   7200
      Top             =   240
      Width           =   2655
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "S T D"
      BeginProperty Font 
         Name            =   "Arial Black"
         Size            =   24
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   675
      Left            =   5640
      TabIndex        =   13
      Top             =   840
      Width           =   1470
   End
   Begin VB.Image Image1 
      Height          =   4680
      Left            =   1080
      Picture         =   "FrmSTD.frx":0000
      Top             =   2760
      Width           =   4785
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Label3"
      Height          =   195
      Left            =   11760
      TabIndex        =   5
      Top             =   6120
      Width           =   480
   End
   Begin VB.Label Label2 
      BackColor       =   &H00808080&
      Caption         =   "S T D Code"
      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            =   6240
      TabIndex        =   2
      Top             =   5280
      Width           =   2175
   End
   Begin VB.Label Label1 
      BackColor       =   &H00808080&
      Caption         =   "City 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            =   6240
      TabIndex        =   0
      Top             =   4560
      Width           =   2175
   End
   Begin VB.Shape Shape1 
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00FFFFFF&
      Height          =   4695
      Left            =   5880
      Top             =   2760
      Width           =   7215
   End
   Begin VB.Shape Shape2 
      BackStyle       =   1  'Opaque
      BorderColor     =   &H00FFFFFF&
      Height          =   1935
      Left            =   5400
      Top             =   240
      Width           =   1815
   End
End
Attribute VB_Name = "Form4"
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 = ""

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 (City or Code) : ")
If sr <> "City" And sr <> "Code" Then
MsgBox "Invalid Column", vbCritical
Exit Sub
End If

Set rs = db.OpenRecordset("Select * from Std 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) = Val(Text2.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("Std")

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 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)
End Sub

⌨️ 快捷键说明

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