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

📄 frmmakereservation.frm

📁 project on Video rental system
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmMakeReservation 
   BackColor       =   &H00FF0000&
   Caption         =   "Make Reservation"
   ClientHeight    =   7245
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6885
   ForeColor       =   &H00FF0000&
   LinkTopic       =   "Form1"
   ScaleHeight     =   7245
   ScaleWidth      =   6885
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdBack 
      Caption         =   "Back"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3960
      TabIndex        =   11
      Top             =   6480
      Width           =   1335
   End
   Begin VB.CommandButton cmdReserve 
      Caption         =   "Submit"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1560
      TabIndex        =   10
      Top             =   6480
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      BackColor       =   &H00FF0000&
      Caption         =   "Make Reservation"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   4215
      Left            =   600
      TabIndex        =   0
      Top             =   1920
      Width           =   5535
      Begin VB.TextBox txtField 
         Height          =   495
         Index           =   4
         Left            =   2520
         TabIndex        =   4
         Top             =   3240
         Width           =   2415
      End
      Begin VB.TextBox txtField 
         Height          =   495
         Index           =   3
         Left            =   2520
         TabIndex        =   3
         Top             =   2400
         Width           =   2415
      End
      Begin VB.TextBox txtField 
         Height          =   495
         Index           =   2
         Left            =   2520
         TabIndex        =   2
         Top             =   1560
         Width           =   2415
      End
      Begin VB.TextBox txtField 
         BeginProperty DataFormat 
            Type            =   1
            Format          =   "d.M.yyyy"
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   3
         EndProperty
         Height          =   495
         Index           =   1
         Left            =   2520
         TabIndex        =   1
         Top             =   720
         Width           =   2415
      End
      Begin VB.Label Label4 
         BackColor       =   &H00FF0000&
         Caption         =   "No.s of copy:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         TabIndex        =   8
         Top             =   3360
         Width           =   1695
      End
      Begin VB.Label Label3 
         BackColor       =   &H00FF0000&
         Caption         =   "Video Id:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         TabIndex        =   7
         Top             =   2520
         Width           =   1695
      End
      Begin VB.Label Label2 
         BackColor       =   &H00FF0000&
         Caption         =   "Member Id:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         TabIndex        =   6
         Top             =   1680
         Width           =   1695
      End
      Begin VB.Label Label1 
         BackColor       =   &H00FF0000&
         Caption         =   "Today's Date:"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   600
         TabIndex        =   5
         Top             =   840
         Width           =   1695
      End
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      BackColor       =   &H00FF0000&
      Caption         =   "Point-of-sale system"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   26.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   615
      Left            =   960
      TabIndex        =   12
      Top             =   960
      Width           =   4695
   End
   Begin VB.Label Label5 
      BackColor       =   &H00FF0000&
      Caption         =   "Millenium Video Store"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   26.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   615
      Left            =   840
      TabIndex        =   9
      Top             =   240
      Width           =   5415
   End
End
Attribute VB_Name = "frmMakeReservation"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdBack_Click()
Unload Me
frmReserve.cmdReserve.Visible = True
frmReserve.cmdBrowse.Visible = True
frmReserve.cmdback.Visible = True
frmReserve.Show

End Sub

Private Sub cmdReserve_Click()
Dim i As Integer

If Len(Trim$(txtField(1).Text)) = 0 Or Len(Trim$(txtField(2).Text)) = 0 Or Len(Trim$(txtField(3).Text)) = 0 Or Len(Trim$(txtField(4).Text)) = 0 Then
    MsgBox "Still got 1 more box haven't fill in lar!"
Else
    MakeReservation
    
End If
     
End Sub

Private Sub MakeReservation()
Dim strFields(1 To 4) As String, srtSQL As String
Dim varData As Variant
Dim i As Integer

For i = 1 To 4
      strFields(i) = ConvertToField(txtField(i).Text, False)
Next i
    
strSQL = "INSERT INTO Reservations(" _
               & "DateReserved,MemberID,VideoID,CopyID)" _
               & " VALUES(" & strFields(1) & "," & strFields(2) _
               & "," & strFields(3) & "," & strFields(4) & ")"
    MsgBox strSQL
If RunActionQuery(strSQL) = 0 Then
        MsgBox "Add unsuccessful. Try again"
End If
End Sub

Private Sub UpdateMember()
Dim strSQL As String, strFields(6) As String
Dim strFields(0) As String
Dim varData As Variant

strFields(6) = ConvertToField(txtField(4).Text, False)
strFields(0) = ConvertToField(txtField(2).Text, False)

strSQL = "INSERT INTO Members " _
        & "TapesReserved = " & strFields(6) _
        & "where ID = " & strFields(0)

If RunActionQuery(strSQL) = 0 Then
    MsgBox "Edit unsuccessful. Try again"

End If

End Sub

⌨️ 快捷键说明

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