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

📄 frmview.frm

📁 project on Video rental system
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmView 
   BackColor       =   &H00FF0000&
   Caption         =   "frmView"
   ClientHeight    =   6990
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6255
   ForeColor       =   &H00FF0000&
   LinkTopic       =   "Form1"
   ScaleHeight     =   6990
   ScaleWidth      =   6255
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdCancel 
      Caption         =   "&Cancel"
      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            =   360
      TabIndex        =   7
      ToolTipText     =   "Back to Rent application form"
      Top             =   6240
      Width           =   1215
   End
   Begin VB.ListBox VideosList 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2940
      ItemData        =   "frmView.frx":0000
      Left            =   360
      List            =   "frmView.frx":0002
      TabIndex        =   2
      Top             =   2760
      Width           =   2895
   End
   Begin VB.TextBox VideosStatus 
      Enabled         =   0   'False
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3015
      Left            =   3480
      MultiLine       =   -1  'True
      TabIndex        =   1
      Top             =   2760
      Width           =   2415
   End
   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            =   4680
      TabIndex        =   0
      ToolTipText     =   "Back to Rent  form"
      Top             =   6240
      Width           =   1215
   End
   Begin VB.Label Label3 
      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            =   840
      TabIndex        =   6
      Top             =   1320
      Width           =   4695
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      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          =   1215
      Left            =   600
      TabIndex        =   5
      Top             =   120
      Width           =   4815
   End
   Begin VB.Label Label2 
      BackColor       =   &H00FF0000&
      Caption         =   "Video Status:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   3600
      TabIndex        =   4
      Top             =   2400
      Width           =   2415
   End
   Begin VB.Label Label1 
      BackColor       =   &H00FF0000&
      Caption         =   "Videos List:"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   375
      Left            =   360
      TabIndex        =   3
      Top             =   2400
      Width           =   2415
   End
End
Attribute VB_Name = "frmView"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdBack_Click()
'frmView.Hide
Unload Me
frmRent.Show
End Sub

Private Sub Command1_Click()

End Sub

Private Sub cmdCancel_Click()
Unload Me
frmRentVideos.Show

End Sub

Private Sub Form_Load()
  'MsgBox ("Welcome to Reservations") ',please enter your member ID and the video ID you want")
   Dim lngRowsRetrieved As Long, strTitle As String
   Dim varData() As Variant
   Dim count As Integer
  
   lngRowsRetrieved = RunSelectQuery("select Title from Videos", varData)
    
    For count = 0 To lngRowsRetrieved - 1
      strTitle = ConvertToString(varData(0, count))
      VideosList.AddItem (strTitle)
      Next count
  
End Sub

Private Sub VideosList_Click()
 'Show information of the selected video
    Dim lngRowsRetrieved As Long, strVideoID As String, strTitle As String, strCopiesAval As String, strNextDue As String, strCopies As String
    Dim varData() As Variant
    Dim reserve As Integer
    Dim ans As Integer
  
 lngRowsRetrieved = RunSelectQuery("select ID,Title,Description," _
                                     & "Director,Year,Price,Copies," _
                                     & "CopiesAvailable from Videos " _
                                     & "where Title = '" & VideosList & "'", varData)
   
   ' lngRowsRetrieved = RunSelectQuery("select ID,Title,Copies" _
    '                   & "CopiesAvailable from Videos " _
     '                  & "where Title = '" & strTitle & "'", varData)
      strVideoID = ConvertToString(varData(0, 0)) 'ID
      strTitle = ConvertToString(varData(1, 0)) 'Title
      strCopies = ConvertToString(varData(2, 0)) 'number of copy
      strCopiesAval = ConvertToString(varData(6, 0)) 'Copies avalable ava
      strNextDue = ConvertToString(varData(7, 0)) 'Next due date
          
    If (strCopiesAval) = 0 Then
      VideosStatus.Text = " Video Title: " + strTitle + vbCrLf + _
                        "Video ID: " + strVideoID + vbCrLf + _
                        "Availability: currently unavailable (Make Reservation?)" + vbCrLf + _
                        "Copies: " + strCopies + vbCrLf + "Next Due: " + strNextDue
                        
     reserve = MsgBox("Make Reservation?", vbYesNo)
         If reserve = vbYes Then
    
         frmReserve.cmdReserve.Visible = True
         frmReserve.cmdBrowse.Visible = True
         frmReserve.cmdback.Visible = True

         'frmView.Hide
         
         Unload Me
         frmReserve.Show
         End If

    Else
      VideosStatus.Text = " Video Title: " + strTitle + vbCrLf + _
                        "Video ID: " + strVideoID + vbCrLf + _
                        "Availability: currently available" + vbCrLf + _
                        "Copies: " + strCopies
      'ans = MsgBox("This video is currently available click Yes to rent its.", vbYesNo, "Video Available")
      'If ans = vbYes Then 'Go to form RENT
        'frmTest.Show
      End If
     'End If
End Sub


⌨️ 快捷键说明

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