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

📄 form2.frm

📁 its our assignment to build interface for a booking system at UMS spisk school
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form2 
   Caption         =   "Form2"
   ClientHeight    =   5775
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   11340
   LinkTopic       =   "Form2"
   ScaleHeight     =   5775
   ScaleWidth      =   11340
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton LeaveButton 
      Caption         =   "LEAVE DEL PROCESS"
      Height          =   495
      Left            =   9120
      TabIndex        =   21
      Top             =   2520
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.CommandButton FindDelButton 
      Caption         =   "FIND && DELETE"
      Height          =   495
      Left            =   5760
      TabIndex        =   20
      Top             =   1200
      Width           =   1215
   End
   Begin VB.ComboBox Combo2 
      Height          =   315
      ItemData        =   "Form2.frx":0000
      Left            =   9000
      List            =   "Form2.frx":0013
      TabIndex        =   19
      Top             =   1200
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      ItemData        =   "Form2.frx":0026
      Left            =   9000
      List            =   "Form2.frx":0057
      TabIndex        =   18
      Top             =   600
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.CommandButton SaveButton 
      Caption         =   "SAVE"
      Height          =   495
      Left            =   5760
      TabIndex        =   15
      Top             =   1920
      Width           =   1215
   End
   Begin VB.CommandButton BackButton 
      Caption         =   "BACK"
      Height          =   495
      Left            =   5760
      TabIndex        =   14
      Top             =   2640
      Width           =   1215
   End
   Begin VB.CommandButton DeleteButton 
      Caption         =   "DELETE"
      Height          =   495
      Left            =   9120
      TabIndex        =   13
      Top             =   1920
      Visible         =   0   'False
      Width           =   1215
   End
   Begin VB.CommandButton AddButton 
      Caption         =   "ADD && BOOK"
      Height          =   495
      Left            =   5760
      TabIndex        =   12
      Top             =   480
      Width           =   1215
   End
   Begin VB.Data Seminar 
      Caption         =   "Use Arrow Buttons to Navigate Records"
      Connect         =   "Access"
      DatabaseName    =   "C:\Program Files\Microsoft Visual Studio\VB98\Project_SE2\db1.mdb"
      DefaultCursorType=   0  'DefaultCursor
      DefaultType     =   2  'UseODBC
      Exclusive       =   0   'False
      Height          =   345
      Left            =   960
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   "Seminar Rooms Book List"
      Top             =   4320
      Width           =   4980
   End
   Begin VB.TextBox Text1 
      DataField       =   "Time"
      DataSource      =   "Seminar"
      Enabled         =   0   'False
      Height          =   495
      Left            =   2400
      TabIndex        =   5
      Text            =   "Text1"
      Top             =   480
      Width           =   2535
   End
   Begin VB.TextBox Text2 
      DataField       =   "Seminar 1"
      DataSource      =   "Seminar"
      Enabled         =   0   'False
      Height          =   495
      Left            =   2400
      TabIndex        =   4
      Text            =   "Text2"
      Top             =   1080
      Width           =   2535
   End
   Begin VB.TextBox Text3 
      DataField       =   "Seminar 2"
      DataSource      =   "Seminar"
      Enabled         =   0   'False
      Height          =   495
      Left            =   2400
      TabIndex        =   3
      Text            =   "Text3"
      Top             =   1680
      Width           =   2535
   End
   Begin VB.TextBox Text4 
      DataField       =   "Seminar 3"
      DataSource      =   "Seminar"
      Enabled         =   0   'False
      Height          =   495
      Left            =   2400
      TabIndex        =   2
      Text            =   "Text4"
      Top             =   2280
      Width           =   2535
   End
   Begin VB.TextBox Text5 
      DataField       =   "Seminar 4"
      DataSource      =   "Seminar"
      Enabled         =   0   'False
      Height          =   495
      Left            =   2400
      TabIndex        =   1
      Text            =   "Text5"
      Top             =   2880
      Width           =   2535
   End
   Begin VB.TextBox Text6 
      DataField       =   "Seminar 5"
      DataSource      =   "Seminar"
      Enabled         =   0   'False
      Height          =   495
      Left            =   2400
      TabIndex        =   0
      Text            =   "Text6"
      Top             =   3480
      Width           =   2535
   End
   Begin VB.Label Label8 
      Caption         =   "SELECT SEMINAR ROOM"
      Height          =   495
      Left            =   7440
      TabIndex        =   17
      Top             =   1200
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.Label Label7 
      Caption         =   "SELECT TIME"
      Height          =   495
      Left            =   7440
      TabIndex        =   16
      Top             =   600
      Visible         =   0   'False
      Width           =   1455
   End
   Begin VB.Label Label1 
      Caption         =   "TIME"
      Height          =   495
      Left            =   720
      TabIndex        =   11
      Top             =   480
      Width           =   1455
   End
   Begin VB.Label Label2 
      Caption         =   "SEMINAR ROOM 1"
      Height          =   495
      Left            =   720
      TabIndex        =   10
      Top             =   1080
      Width           =   1455
   End
   Begin VB.Label Label3 
      Caption         =   "SEMINAR ROOM 2"
      Height          =   495
      Left            =   720
      TabIndex        =   9
      Top             =   1680
      Width           =   1455
   End
   Begin VB.Label Label4 
      Caption         =   "SEMINAR ROOM 3"
      Height          =   495
      Left            =   720
      TabIndex        =   8
      Top             =   2280
      Width           =   1455
   End
   Begin VB.Label Label5 
      Caption         =   "SEMINAR ROOM 4"
      Height          =   495
      Left            =   720
      TabIndex        =   7
      Top             =   2880
      Width           =   1455
   End
   Begin VB.Label Label6 
      Caption         =   "SEMINAR ROOM 5"
      Height          =   495
      Left            =   720
      TabIndex        =   6
      Top             =   3480
      Width           =   1455
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub AddButton_Click()
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
FindDelButton.Enabled = False
BackButton.Enabled = False
End Sub

Private Sub BackButton_Click()
Form1.Visible = True
Form2.Visible = False
End Sub



Private Sub DeleteButton_Click()
blnFirstFind = False


Dim strCriteria

If Combo1.Text = " " Or Combo2.Text = " " Then
 If MsgBox("Please fill in time and seminar room before deleting data", vbOKCancel) = vbCancel Then
Label7.Visible = False
Label8.Visible = False
DeleteButton.Visible = False
Combo1.Visible = False
Combo2.Visible = False
LeaveButton.Visible = False
AddButton.Enabled = True
FindDelButton.Enabled = True
SaveButton.Enabled = True
BackButton.Enabled = True
Exit Sub
 Else
 Exit Sub
 End If
End If

If Combo1.Text = "8:00:00 AM" Then
strCriteria = "Time = #8:00:00 AM# "
End If

If Combo1.Text = "9:00:00 AM" Then
strCriteria = "Time = #9:00:00 AM# "
End If

If Combo1.Text = "10:00:00 AM" Then
strCriteria = "Time = #10:00:00 AM# "
End If

If Combo1.Text = "11:00:00 AM" Then
strCriteria = "Time = #11:00:00 AM# "
End If

If Combo1.Text = "12:00:00 PM" Then
strCriteria = "Time = #12:00:00 PM# "
End If

If Combo1.Text = "1:00:00 PM" Then
strCriteria = "Time = #1:00:00 PM# "
End If

If Combo1.Text = "2:00:00 PM" Then
strCriteria = "Time = #2:00:00 PM# "
End If
If Combo1.Text = "3:00:00 PM" Then
strCriteria = "Time = #3:00:00 PM# "
End If

If Combo1.Text = "4:00:00 PM" Then
strCriteria = "Time = #4:00:00 PM# "
End If

If Combo1.Text = "5:00:00 PM" Then
strCriteria = "Time = #5:00:00 PM# "
End If

If Combo1.Text = "6:00:00 PM" Then
strCriteria = "Time = #6:00:00 PM# "
End If

If Combo1.Text = "7:00:00 PM" Then
strCriteria = "Time = #7:00:00 PM# "
End If

If Combo1.Text = "8:00:00 PM" Then
strCriteria = "Time = #8:00:00 PM# "
End If

If Combo1.Text = "9:00:00 PM" Then
strCriteria = "Time = #9:00:00 PM# "
End If

If Combo1.Text = "10:00:00 PM" Then
strCriteria = "Time = #10:00:00 PM# "
End If

Seminar.Recordset.FindFirst strCriteria

If MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo + vbDefaultButton2, "Confirm") = vbNo Then

Exit Sub
End If


Label7.Visible = False
Label8.Visible = False
DeleteButton.Visible = False
Combo1.Visible = False
Combo2.Visible = False
AddButton.Enabled = True
FindDelButton.Enabled = True
SaveButton.Enabled = True
BackButton.Enabled = True
LeaveButton.Visible = True


If Combo2.Text = "1" Then
If Text2.Text = " " Then
If MsgBox("No Data Found", vbOKOnly) = vbOK Then
LeaveButton_Click
Exit Sub
End If
End If
Text2.Text = " "
LeaveButton_Click
End If


If Combo2.Text = "2" Then
If Text3.Text = " " Then
If MsgBox("No Data Found", vbOKOnly) = vbOK Then
LeaveButton_Click
Exit Sub
End If
End If
Text3.Text = " "
LeaveButton_Click
End If


If Combo2.Text = "3" Then
If Text4.Text = " " Then
If MsgBox("No Data Found", vbOKOnly) = vbOK Then
LeaveButton_Click
Exit Sub
End If
End If
Text4.Text = " "
LeaveButton_Click
End If


If Combo2.Text = "4" Then
If Text5.Text = " " Then
If MsgBox("No Data Found", vbOKOnly) = vbOK Then
LeaveButton_Click
Exit Sub
End If
End If
Text5.Text = " "
LeaveButton_Click
End If


If Combo2.Text = "5" Then
If Text6.Text = " " Then
If MsgBox("No Data Found", vbOKOnly) = vbOK Then
LeaveButton_Click
Exit Sub
End If
End If
Text6.Text = " "
LeaveButton_Click
End If

End Sub


Private Sub FindDelButton_Click()
blnFirstFind = True
LeaveButton.Visible = True
Label7.Visible = True
Label8.Visible = True
DeleteButton.Visible = True
Combo1.Visible = True
Combo2.Visible = True
AddButton.Enabled = False
FindDelButton.Enabled = False
SaveButton.Enabled = False
BackButton.Enabled = False
End Sub

Private Sub Form_Load()
Combo1.Text = Combo1.List(0)
Combo2.Text = Combo2.List(0)
End Sub

Private Sub SaveButton_Click()

Text2.Enabled = False
Text3.Enabled = False
Text4.Enabled = False
Text5.Enabled = False
Text6.Enabled = False
FindDelButton.Enabled = True
BackButton.Enabled = True


End Sub


Private Sub LeaveButton_Click()
Label7.Visible = False
Label8.Visible = False
DeleteButton.Visible = False
Combo1.Visible = False
Combo2.Visible = False
LeaveButton.Visible = False
AddButton.Enabled = True
FindDelButton.Enabled = True
SaveButton.Enabled = True
BackButton.Enabled = True
End Sub

⌨️ 快捷键说明

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