AIM:To prepare a form for students information using data control
CODE
Form 1 Private Sub ADD_Click(Index As Integer) DATA.Recordset.AddNew End Sub Private Sub DELETE_Click(Index As Integer) On Error Resume Next DATA.Recordset.DELETE If Not DATA.Recordset.EOF Then DATA.Recordset.MoveNext Else If Not DATA.Recordset.BOF Then DATA.Recordset.MovePrevious Else MsgBox "THIS WAS THE LAST RECORD IN THE TABLE" End If End If End Sub Private Sub EXIT_Click(Index As Integer) End End Sub Private Sub FIND_Click(Index As Integer) Dim NAME As String NAME = InputBox("ENTER THE NAME TO SEARCH", "SEARCH FOR ") DATA.Recordset.Index = "NAME" DATA.Recordset.Seek "=", NAME End Sub 59 Private Sub FIRST_Click(Index As Integer) DATA.Recordset.MoveFirst End Sub Private Sub LAST_Click(Index As Integer) DATA.Recordset.MoveLast End Sub Private Sub NEXT_Click(Index As Integer) DATA.Recordset.MoveNext If DATA.Recordset.EOF Then MsgBox "YOU ARE ON THE LAST RECORD" DATA.Recordset.MoveLast End If End Sub Private Sub PREV_Click(Index As Integer) DATA.Recordset.MovePrevious If DATA.Recordset.BOF Then MsgBox "YOU ARE ON THE FIRST RECORD" DATA.Recordset.MoveFirst End If End Sub
0 comments:
Post a Comment