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

📄 frmbrowse.frm

📁 project on Video rental system
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmBrowse 
   BackColor       =   &H00FF0000&
   Caption         =   "Video Info"
   ClientHeight    =   6780
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6615
   ForeColor       =   &H00FF0000&
   LinkTopic       =   "Form1"
   ScaleHeight     =   6780
   ScaleWidth      =   6615
   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            =   4680
      TabIndex        =   4
      ToolTipText     =   "Back to reservation form"
      Top             =   5760
      Width           =   1215
   End
   Begin VB.TextBox txtField 
      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            =   3600
      MultiLine       =   -1  'True
      TabIndex        =   1
      Top             =   1440
      Width           =   2415
   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        =   "frmBrowse.frx":0000
      Left            =   480
      List            =   "frmBrowse.frx":0002
      TabIndex        =   0
      Top             =   1440
      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            =   480
      TabIndex        =   3
      Top             =   1080
      Width           =   2415
   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            =   3720
      TabIndex        =   2
      Top             =   1080
      Width           =   2415
   End
End
Attribute VB_Name = "frmBrowse"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub cmdBack_Click()
Unload Me
frmReserve.cmdReserve.Visible = True
frmReserve.cmdBrowse.Visible = True
frmReserve.cmdback.Visible = True
frmReserve.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 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
      txtField.Text = " Video Title: " + strTitle + vbCrLf + _
                        "Video ID: " + strVideoID + vbCrLf + _
                        "Availability: currently unavailable" + vbCrLf + _
                        "Copies: " + strCopies + vbCrLf + "Next Due: " + strNextDue
    Else
      txtField.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 + -