frmDelete.frm

 VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmDelete
   BackColor       =   &H8000000E&
   Caption         =   "Form1"
   ClientHeight    =   8775
   ClientLeft      =   60
   ClientTop       =   375
   ClientWidth     =   10395
   LinkTopic       =   "Form1"
   Moveable        =   0   'False
   ScaleHeight     =   8775
   ScaleWidth      =   10395
   StartUpPosition =   2  'CenterScreen
   Begin MSDataGridLib.DataGrid DataGrid1
      Bindings        =   "frmDelete.frx":0000
      Height          =   2175
      Left            =   240
      TabIndex        =   36
      Top             =   960
      Width           =   9735
      _ExtentX        =   17171
      _ExtentY        =   3836
      _Version        =   393216
      BackColor       =   -2147483625
      ForeColor       =   -2147483624
      HeadLines       =   1
      RowHeight       =   15
      FormatLocked    =   -1  'True
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   10
      BeginProperty Column00
         DataField       =   "SN"
         Caption         =   "SN"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01
         DataField       =   "LN"
         Caption         =   "LN"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column02
         DataField       =   "FN"
         Caption         =   "FN"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column03
         DataField       =   "MI"
         Caption         =   "MI"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column04
         DataField       =   "DOB"
         Caption         =   "DOB"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column05
         DataField       =   "ADD"
         Caption         =   "ADD"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column06
         DataField       =   "CN"
         Caption         =   "CN"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column07
         DataField       =   "COURSE"
         Caption         =   "COURSE"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column08
         DataField       =   "YEARLEV"
         Caption         =   "YEARLEV"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column09
         DataField       =   "Picture"
         Caption         =   "Picture"
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   1033
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0
         BeginProperty Column00
            ColumnWidth     =   915.024
         EndProperty
         BeginProperty Column01
            ColumnWidth     =   1739.906
         EndProperty
         BeginProperty Column02
            ColumnWidth     =   1739.906
         EndProperty
         BeginProperty Column03
            ColumnWidth     =   1739.906
         EndProperty
         BeginProperty Column04
            ColumnWidth     =   1739.906
         EndProperty
         BeginProperty Column05
            ColumnWidth     =   1739.906
         EndProperty
         BeginProperty Column06
            ColumnWidth     =   1739.906
         EndProperty
         BeginProperty Column07
            ColumnWidth     =   1739.906
         EndProperty
         BeginProperty Column08
            ColumnWidth     =   1739.906
         EndProperty
         BeginProperty Column09
            ColumnWidth     =   1739.906
         EndProperty
      EndProperty
   End
   Begin VB.CommandButton Command1
      Caption         =   "Retrieve the Photo"
      Height          =   255
      Left            =   8160
      TabIndex        =   35
      Top             =   3960
      Width           =   1695
   End
   Begin VB.CommandButton cmdPicShow
      Height          =   375
      Left            =   6840
      Style           =   1  'Graphical
      TabIndex        =   33
      ToolTipText     =   "View Picture"
      Top             =   7080
      Width           =   495
   End
   Begin VB.Frame fraNavigation
      BackColor       =   &H8000000E&
      Height          =   800
      Left            =   240
      TabIndex        =   24
      Top             =   7800
      Width           =   1725
      Begin VB.CommandButton cmdNavigate
         Height          =   265
         Index           =   3
         Left            =   1320
         Style           =   1  'Graphical
         TabIndex        =   29
         Top             =   120
         Width           =   400
      End
      Begin VB.CommandButton cmdNavigate
         Height          =   265
         Index           =   2
         Left            =   840
         Style           =   1  'Graphical
         TabIndex        =   28
         Top             =   120
         Width           =   400
      End
      Begin VB.CommandButton cmdNavigate
         Height          =   265
         Index           =   1
         Left            =   480
         Style           =   1  'Graphical
         TabIndex        =   27
         Top             =   120
         Width           =   400
      End
      Begin VB.CommandButton cmdNavigate
         Height          =   265
         Index           =   0
         Left            =   30
         Style           =   1  'Graphical
         TabIndex        =   26
         Top             =   120
         Width           =   400
      End
      Begin VB.TextBox txtcount
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H8000000E&
         BorderStyle     =   0  'None
         BeginProperty Font
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   285
         Left            =   120
         TabIndex        =   25
         Top             =   480
         Width           =   615
      End
      Begin VB.Label Label12
         BackStyle       =   0  'Transparent
         Caption         =   "  of"
         BeginProperty Font
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   255
         Left            =   720
         TabIndex        =   31
         Top             =   480
         Width           =   255
      End
      Begin VB.Label lblmax
         Alignment       =   2  'Center
         Appearance      =   0  'Flat
         BackColor       =   &H80000005&
         BackStyle       =   0  'Transparent
         BeginProperty Font
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   285
         Left            =   1080
         TabIndex        =   30
         Top             =   480
         Width           =   705
      End
   End
   Begin VB.CommandButton cmdClose
      Cancel          =   -1  'True
      Height          =   615
      Left            =   9480
      Picture         =   "frmDelete.frx":0015
      Style           =   1  'Graphical
      TabIndex        =   21
      Top             =   7800
      Width           =   615
   End
   Begin VB.CommandButton cmdDelete
      Height          =   615
      Left            =   8760
      Picture         =   "frmDelete.frx":04A9
      Style           =   1  'Graphical
      TabIndex        =   20
      Top             =   7800
      Width           =   615
   End
   Begin VB.TextBox txtCN
      Height          =   285
      Left            =   2280
      TabIndex        =   8
      Top             =   7200
      Width           =   3255
   End
   Begin VB.TextBox txtAdd
      Height          =   855
      Left            =   1440
      MultiLine       =   -1  'True
      TabIndex        =   7
      Top             =   6240
      Width           =   3975
   End
   Begin VB.ComboBox cmbYear
      Height          =   315
      Left            =   4440
      TabIndex        =   6
      Top             =   5280
      Width           =   1095
   End
   Begin VB.ComboBox cmbCourse
      Height          =   315
      Left            =   1080
      TabIndex        =   5
      Top             =   5280
      Width           =   1455
   End
   Begin VB.TextBox txtMI
      Height          =   285
      Left            =   5400
      TabIndex        =   4
      Top             =   4320
      Width           =   615
   End
   Begin VB.TextBox txtFN
      Height          =   285
      Left            =   2880
      TabIndex        =   3
      Top             =   4320
      Width           =   2415
   End
   Begin VB.TextBox txtLN
      Height          =   285
      Left            =   360
      TabIndex        =   2
      Top             =   4320
      Width           =   2415
   End
   Begin VB.TextBox txtSN
      Height          =   285
      Left            =   2280
      TabIndex        =   1
      Top             =   3840
      Width           =   1215
   End
   Begin MSComCtl2.DTPicker DTDOB
      Height          =   255
      Left            =   1920
      TabIndex        =   9
      Top             =   5880
      Width           =   2415
      _ExtentX        =   4260
      _ExtentY        =   450
      _Version        =   393216
      Format          =   16580609
      CurrentDate     =   40171
   End
   Begin Viray.Photo PicBox
      Height          =   2775
      Left            =   6600
      TabIndex        =   32
      Top             =   4200
      Width           =   3255
      _ExtentX        =   5741
      _ExtentY        =   4895
   End
   Begin MSAdodcLib.Adodc Adodc1
      Height          =   375
      Left            =   5640
      Top             =   1920
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   661
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=viray.mdb;Persist Security Info=False"
      OLEDBString     =   "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=viray.mdb;Persist Security Info=False"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "tblViray"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "View Picture"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   12
      Left            =   7440
      TabIndex        =   34
      Top             =   7200
      Width           =   1695
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Delete"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   11
      Left            =   8760
      TabIndex        =   23
      Top             =   8400
      Width           =   615
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Exit"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   1
      Left            =   9600
      TabIndex        =   22
      Top             =   8400
      Width           =   375
   End
   Begin VB.Line Line3
      X1              =   240
      X2              =   10200
      Y1              =   7680
      Y2              =   7680
   End
   Begin VB.Line Line1
      X1              =   120
      X2              =   10200
      Y1              =   840
      Y2              =   840
   End
   Begin VB.Line Line2
      X1              =   240
      X2              =   10200
      Y1              =   3600
      Y2              =   3600
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Student Number:"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   10
      Left            =   360
      TabIndex        =   19
      Top             =   3840
      Width           =   1695
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "LastName"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   9
      Left            =   1080
      TabIndex        =   18
      Top             =   4680
      Width           =   1095
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "First Name"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   8
      Left            =   3600
      TabIndex        =   17
      Top             =   4680
      Width           =   975
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "MI"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   7
      Left            =   5520
      TabIndex        =   16
      Top             =   4680
      Width           =   375
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Course"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   6
      Left            =   360
      TabIndex        =   15
      Top             =   5280
      Width           =   735
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Year Level"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   5
      Left            =   3120
      TabIndex        =   14
      Top             =   5280
      Width           =   1095
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Date of Birth"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   4
      Left            =   360
      TabIndex        =   13
      Top             =   5880
      Width           =   1335
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Address"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   3
      Left            =   360
      TabIndex        =   12
      Top             =   6240
      Width           =   855
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Contact Number"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   2
      Left            =   360
      TabIndex        =   11
      Top             =   7200
      Width           =   1695
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Choose a Record to Delete"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Index           =   14
      Left            =   360
      TabIndex        =   10
      Top             =   3240
      Width           =   2415
   End
   Begin VB.Label Label1
      BackStyle       =   0  'Transparent
      Caption         =   "Delete Record"
      BeginProperty Font
         Name            =   "Tahoma"
         Size            =   15.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Index           =   0
      Left            =   1080
      TabIndex        =   0
      Top             =   240
      Width           =   2535
   End
   Begin VB.Image Image1
      Height          =   495
      Left            =   240
      Picture         =   "frmDelete.frx":08B6
      Top             =   120
      Width           =   495
   End
End
Attribute VB_Name = "frmDelete"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim RS As New ADODB.Recordset
Dim cn As New ADODB.Connection
Private Sub cmdClose_Click()
Unload Me
End Sub


Private Sub cmdDelete_Click()
On Error GoTo hell
    With RS
      
        If .RecordCount < 1 Then MsgBox "No record to delete.", vbExclamation: Exit Sub
   

Dim ans As Integer, pos As Integer
        ans = MsgBox("Are you sure you want to delete the selected record?", vbCritical + vbYesNo, "Confirm Record Deletion")
        Screen.MousePointer = vbHourglass
        If ans = vbYes Then
            '-Delete the record
            pos = .AbsolutePosition
            cn.BeginTrans
            .Delete
            .Requery
            cn.CommitTrans
            If pos > .RecordCount Then
                If Not .EOF Or .BOF Then .MoveFirst
            Else
                .AbsolutePosition = pos
            End If
            MsgBox "Record has been successfully deleted.", vbInformation, "Confirm"
        End If
        Screen.MousePointer = vbDefault
        txtSN.Text = ""
        txtLN.Text = ""
        txtFN.Text = ""
        txtMI.Text = ""
        cmbCourse.Text = ""
        cmbYear.Text = ""
       
        txtAdd.Text = ""
        txtCN.Text = ""
    End With

Exit Sub

hell:
    Handler Err
End Sub

Private Sub cmdNavigate_Click(Index As Integer)
Navigate Index, RS
    DisplayRecords
End Sub

Private Sub cmdPicShow_Click()
On Error Resume Next
        Kill "tmp.jpg"
        SavePicture PicBox.Picture, "tmp.jpg"
        ShellEx "tmp.jpg"
End Sub

Private Sub Command1_Click()
Dim RS As New ADODB.Recordset

    With RS
        .Open "SELECT [Picture] FROM tblViray WHERE LN='" & txtLN.Text & "'", cn, adOpenForwardOnly, adLockOptimistic
        If Len(RS!Picture) > 0 Then
            PicBox.LoadPhoto RS!Picture
        Else
            Set PicBox.Picture = LoadPicture()
        End If
        .Close
    End With
    Set RS = Nothing
End Sub

Private Sub Form_Load()
Locker
AnimateForm Me, aLoad, aMedium

Set cn = New ADODB.Connection
Set RS = New ADODB.Recordset
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\Viray.mdb;"
With RS
        .ActiveConnection = cn
        .CursorLocation = adUseClient
        .CursorType = adOpenDynamic
        .LockType = adLockOptimistic
        .Source = "select * from tblViray"
        .Open
End With


        With RS
            If .RecordCount < 1 Then
                txtcount.Text = 0
            Else
                txtcount.Text = .AbsolutePosition
            End If
            lblmax.Caption = .RecordCount
        End With
       
       
        With RS
         txtSN.Text = .Fields("SN")
                txtLN.Text = .Fields("LN")
                txtFN.Text = .Fields("FN")
                txtMI.Text = .Fields("MI")
                cmbCourse.Text = .Fields("COURSE")
                cmbYear.Text = .Fields("YEARLEV")
                txtAdd.Text = .Fields("ADD")
                txtCN.Text = .Fields("CN")
                DTDOB.Value = .Fields("DOB")
            End With
End Sub

Private Sub Form_Unload(Cancel As Integer)
AnimateForm Me, aUnload, aMedium
End Sub

Private Sub lvw_Click()
lblSelector.Caption = lvw.ListItems(lvw.SelectedItem.Index)
End Sub
Private Sub Locker()
txtSN.Locked = True
txtLN.Locked = True
txtFN.Locked = True
txtMI.Locked = True
cmbCourse.Locked = True
cmbYear.Locked = True
txtAdd.Locked = True
txtCN.Locked = True
End Sub
Private Sub DisplayRecords()

'Display the current and total number of record

Dim i As Integer

    On Error Resume Next
        With RS
            If .RecordCount < 1 Then
                txtcount.Text = 0
            Else
                txtcount.Text = .AbsolutePosition
            End If
            lblmax.Caption = .RecordCount

            For i = 0 To 6
                txtSN.Text = .Fields("SN")
                txtLN.Text = .Fields("LN")
                txtFN.Text = .Fields("FN")
                txtMI.Text = .Fields("MI")
                cmbCourse.Text = .Fields("COURSE")
                cmbYear.Text = .Fields("YEARLEV")
                txtAdd.Text = .Fields("ADD")
                txtCN.Text = .Fields("CN")
                DTDOB.Value = .Fields("DOB")
            Next i
        End With
      
End Sub

Project Homepage: