vOption Explicit
Dim oper As String
Dim mchoice As Integer
Dim mrollno As Integer
Private Sub CMDADD_Click()
oper = "ADD"
clear
disable
[Link]
End Sub
Private Sub CMDCANCEL_Click()
oper = ""
Display
able
End Sub
Private Sub CMDDELETE_Click()
mchoice = MsgBox("Are you Sure", vbYesNo + vbQuestion)
If mchoice = vbYes Then
[Link]
[Link]
If [Link] = 0 Then
MsgBox "No Record Available"
Exit Sub
End If
If [Link] Then
[Link]
End If
Display
End If
End Sub
Private Sub CMDEXIT_Click()
Unload Me
End Sub
Private Sub CMDFIRST_Click()
[Link]
Display
End Sub
Private Sub CMDLAST_Click()
[Link]
Display
End Sub
Private Sub CMDNEXT_Click()
[Link]
If [Link] Then
MsgBox "Last Record Is Encounted"
[Link]
End If
Display
End Sub
Private Sub CMDPREVIOUS_Click()
[Link]
If [Link] Then
MsgBox "First Record Is Encounted"
[Link]
End If
Display
End Sub
Private Sub CMDSAVE_Click()
If oper = "ADD" Then
[Link]
oper = ""
End If
[Link]("rollno") = txtRollno
[Link]("sname") = txtName
If [Link] = True Then
[Link]("sex") = "M"
Else
[Link]("sex") = "F"
End If
[Link]("dob") = txtdob
[Link]("class") = cmbClass
[Link]
able
End Sub
Private Sub CMDSEARCH_Click()
mrollno = Val(InputBox("Enter RollNo"))
[Link]
Do While Not [Link]
If [Link]("RollNo") = mrollno Then
Display
Exit Sub
End If
[Link]
Loop
MsgBox "record does not exist"
End Sub
Private Sub Form_Load()
[Link]
If [Link] <> 0 Then
Display
Else
MsgBox "Table Is Empty"
End If
able
End Sub
Public Sub Display()
txtRollno = [Link]("rollno")
txtName = [Link]("sname")
If [Link]("sex") = "M" Then
[Link] = True
Else
[Link] = True
End If
txtdob = [Link]("dob")
cmbClass = [Link]("class")
End Sub
Public Sub clear()
[Link] = ""
[Link] = ""
[Link] = ""
End Sub
Private Sub txtName_keypress(KeyAscii As Integer)
If KeyAscii >= 97 And KeyAscii <= 122 Then
KeyAscii = KeyAscii - 32
End If
End Sub
Private Sub txtRollno_KeyPress(KeyAscii As Integer)
If ((KeyAscii >= 65 And KeyAscii <= 90) Or (KeyAscii >= 97 And KeyAscii < 122))
Then
KeyAscii = 0
End If
End Sub
Public Sub able()
[Link] = True
[Link] = False
[Link] = False
[Link] = True
[Link] = True
[Link] = True
[Link] = True
[Link] = True
[Link] = True
End Sub
Public Sub disable()
[Link] = False
[Link] = True
[Link] = True
[Link] = False
[Link] = False
[Link] = False
[Link] = False
[Link] = False
[Link] = False
End Sub