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

📄 frmsrchissue.frm

📁 图书管理系统是针对学校和个人有一定的作用软件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSrchIssue 
   Caption         =   "Search for Issue Information"
   ClientHeight    =   5760
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   6975
   Icon            =   "frmSrchIssue.frx":0000
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   MinButton       =   0   'False
   ScaleHeight     =   5760
   ScaleWidth      =   6975
   WindowState     =   2  'Maximized
   Begin VB.TextBox txtLibraryId 
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3120
      Locked          =   -1  'True
      TabIndex        =   7
      TabStop         =   0   'False
      Top             =   2160
      Width           =   2655
   End
   Begin VB.TextBox txtReturnDate 
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3120
      Locked          =   -1  'True
      TabIndex        =   14
      Top             =   2160
      Visible         =   0   'False
      Width           =   2535
   End
   Begin VB.CommandButton cmdMemberOpen 
      Caption         =   "..."
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   5880
      TabIndex        =   8
      Top             =   2160
      Width           =   495
   End
   Begin VB.TextBox txtFineAmt 
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3120
      Locked          =   -1  'True
      TabIndex        =   6
      TabStop         =   0   'False
      Top             =   3360
      Width           =   2655
   End
   Begin VB.TextBox txtDaysUsed 
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3120
      Locked          =   -1  'True
      TabIndex        =   5
      TabStop         =   0   'False
      Top             =   2760
      Width           =   2655
   End
   Begin VB.Frame Frame1 
      Caption         =   "Enter BookId and Press Enter"
      ForeColor       =   &H00FF0000&
      Height          =   735
      Left            =   480
      TabIndex        =   0
      Top             =   600
      Width           =   6135
      Begin VB.CommandButton cmdBookOpen 
         Caption         =   "..."
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   5280
         TabIndex        =   3
         Top             =   240
         Width           =   495
      End
      Begin VB.TextBox txtBookId 
         BackColor       =   &H0080FFFF&
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H00FF0000&
         Height          =   375
         Left            =   2640
         TabIndex        =   2
         Top             =   240
         Width           =   2415
      End
      Begin VB.Label lblBookId 
         AutoSize        =   -1  'True
         Caption         =   "&Book Id"
         BeginProperty Font 
            Name            =   "Times New Roman"
            Size            =   14.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   330
         Left            =   240
         TabIndex        =   1
         Top             =   240
         Width           =   990
      End
   End
   Begin VB.TextBox txtIssueDate 
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3120
      Locked          =   -1  'True
      TabIndex        =   4
      TabStop         =   0   'False
      Top             =   1560
      Width           =   2535
   End
   Begin VB.Label lblLibraryId 
      AutoSize        =   -1  'True
      Caption         =   "&Library Id"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   720
      TabIndex        =   12
      Top             =   2160
      Width           =   1260
   End
   Begin VB.Label lblReturnDate 
      AutoSize        =   -1  'True
      Caption         =   "&Return Date"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   720
      TabIndex        =   15
      Top             =   2160
      Visible         =   0   'False
      Width           =   1515
   End
   Begin VB.Label lblInfo 
      Alignment       =   2  'Center
      BackColor       =   &H00000080&
      Caption         =   "Search for Issue Information"
      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            =   0
      TabIndex        =   13
      Top             =   0
      Width           =   5775
   End
   Begin VB.Label lblFineAmt 
      AutoSize        =   -1  'True
      Caption         =   "&Fine Amount"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   720
      TabIndex        =   11
      Top             =   3360
      Width           =   1575
   End
   Begin VB.Label lblDaysUsed 
      AutoSize        =   -1  'True
      Caption         =   "&Days Used"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   720
      TabIndex        =   10
      Top             =   2760
      Width           =   1290
   End
   Begin VB.Label lblIssueDate 
      AutoSize        =   -1  'True
      Caption         =   "&Issue Date"
      BeginProperty Font 
         Name            =   "Times New Roman"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   720
      TabIndex        =   9
      Top             =   1560
      Width           =   1290
   End
End
Attribute VB_Name = "frmSrchIssue"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'=====================================================
'*****************************************************
'* Programmed by : Vivek Patel                       *
'* Contact :  Email   => vivek_patel9@rediffmail.com *
'*            Website => www.VIVEKPATEL.cjb.net      *
'* Description : Search Code for Issue Info          *
'* Vote For Me : If you really enjoy this utility or *
'                 helped by any of the functionality *
'                 than plz. reward us by your VOTE.  *
'*****************************************************
'=====================================================

Private Sub Form_Load()
    'Setting up the info. label
    lblInfo.Left = Me.ScaleLeft
    lblInfo.Top = Me.ScaleTop
    lblInfo.Width = Screen.Width
    txtFineAmt.Visible = False
    lblFineAmt.Visible = False
    'Frame2.Left = (Screen.Width - Frame2.Width) / 2
    If rsIssueInfo.RecordCount = 0 Then
        MsgBox "No Book Issued", vbInformation, "Record Issue Book Record"
        Unload Me
    End If
    'cmdSave.Enabled = False
End Sub

Private Sub Form_Activate()
    clear
End Sub

Private Sub cmdBookOpen_Click()
    frmBookInfo.Show
    frmBookInfo.SetFocus
End Sub

Private Sub cmdMemberOpen_Click()
    frmMemberInfo.Show
    frmMemberInfo.SetFocus
End Sub


'========================================================
'Database Related Code...!!!
'========================================================
'Private Sub cmdCancel_Click()
'    clear
'End Sub
'
''Delete Record  or Return Book
'Private Sub cmdsave_click()
''On Error Resume Next
'    If txtLibraryId.Text = "" Then
'        cmdSave.Enabled = False
'    End If
'    rsIssueInfo.Delete
'    txtFineAmt.Visible = False
'    lblFineAmt.Visible = False
'    Call clear
'End Sub
'
'Supporting Function
'Simple clearing of textBox
Private Sub clear()
    txtIssueDate.Text = ""
    txtBookId.Text = ""
    txtDaysUsed.Text = ""
    txtFineAmt.Text = ""
    txtLibraryId.Text = ""
    txtReturnDate.Text = ""
    txtFineAmt.Visible = False
    lblFineAmt.Visible = False
    txtBookId.SetFocus
End Sub


Private Sub Txtbookid_KeyPress(KeyAscii As Integer)
    Dim BookNo As String
    Dim issueDate As Date
    Dim currDate As Date
    Dim totalDaysUsed As Integer
    Dim totalFineAmt As Integer
    
    'assigning Srch value
    BookNo = txtBookId.Text
    
    'If enter is pressed by user than auto-generate record
    If KeyAscii = 13 Then
        clear
        'Prompt if invalid search key is entered by user
        If Not IsNumeric(BookNo) Then
            MsgBox "Invalid Search Key Entered", vbCritical, "Search Error"
            Call clear
            Exit Sub
        End If
        
        rsIssueInfo.MoveFirst
        For i = 0 To rsIssueInfo.RecordCount
            If rsIssueInfo.EOF = True Then
                Exit For
            End If
            If rsIssueInfo(0) = Val(Trim$(BookNo)) Then
                txtLibraryId.Text = rsIssueInfo(2)
                txtReturnDate.Text = Format(Now, "mm/dd/yy")
                txtIssueDate.Text = rsIssueInfo(1)
                issueDate = CDate(txtIssueDate.Text)
                currDate = CDate(Format(Now, "mm/dd/yy"))
                totalDaysUsed = DateDiff("d", issueDate, currDate)
                If totalDaysUsed > maxDays Then
                    txtFineAmt.Visible = True
                    lblFineAmt.Visible = True
                    totalDaysUsed = totalDaysUsed - maxDays
                    totalFineAmt = fineAmt * totalDaysUsed
                    txtDaysUsed.ForeColor = vbRed
                    txtFineAmt.ForeColor = vbRed
                    txtDaysUsed.Text = totalDaysUsed & " Days Beyond Limit"
                    txtFineAmt.Text = "$" & totalFineAmt
                Else
                    txtDaysUsed.ForeColor = vbBlack
                    txtFineAmt.Visible = False
                    lblFineAmt.Visible = False
                    txtDaysUsed.Text = totalDaysUsed
                End If
                'txtDaysUsed.Text = totalDaysUsed
                'MsgBox "Total days used  " & totalDaysUsed & " And Fine amt is " & totalFineAmt
                Exit For
            End If
            rsIssueInfo.MoveNext
        Next
        
        
        If txtLibraryId.Text = "" Then
            MsgBox "Book Not Issued", vbInformation, "Search Not Found"
            'cmdSave.Enabled = False
            clear
        End If
    End If
End Sub

'=====================================================
'*****************************************************
'* Vote For Me : If you really enjoy this utility or *
'                 helped by any of the functionality *
'                 than plz. reward us by your VOTE.  *
'*****************************************************
'=====================================================






⌨️ 快捷键说明

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