Option Explicit
Dim C As New Connection
Dim R As New Recordset
Dim S As String
Private Sub cmdAdd_Click()
txtPcode.Text = ""
txtPname.Text = ""
txtPaddr.Text = ""
txtNOM.Text = ""
txtPcode.SetFocus
End Sub
Private Sub cmdNext_Click()
R.MoveNext
If Not R.EOF Then
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtPaddr.Text = R.Fields(2).Value
txtNOM.Text = R.Fields(3).Value
Else
MsgBox "No More Records!", vbInformation, "Player"
End If
End Sub
Private Sub cmdPrev_Click()
R.MovePrevious
If Not R.BOF Then
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtPaddr.Text = R.Fields(2).Value
txtNOM.Text = R.Fields(3).Value
Else
MsgBox "No More Records!", vbInformation, "Player"
End If
End Sub
Private Sub cmdSave_Click()
R.Close
S = "Insert Into tblPlayer Values(" & Val(txtPcode.Text) & ",'" & txtPname.Text & "','" & txtPaddr.Text & "', '" & Val(txtNOM.Text) & "')"
R.Open S, C, adOpenDynamic, adLockOptimistic
S = "Select * From tblPlayer"
R.Open S, C, adOpenDynamic, adLockOptimistic
If Not R.BOF And Not R.EOF Then
R.MoveFirst
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtPaddr.Text = R.Fields(2).Value
txtNOM.Text = R.Fields(3).Value
End If
MsgBox "Player record Added Successfully!", vbInformation, "Player"
End Sub
Private Sub Form_Load()
S = "Select * From tblPlayer"
C.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\VBSlipSol\Slip22\Ques-2\player.mdb;Persist Security Info=False"
R.Open S, C, adOpenDynamic, adLockOptimistic
If Not R.BOF And Not R.EOF Then
R.MoveFirst
txtPcode.Text = R.Fields(0).Value
txtPname.Text = R.Fields(1).Value
txtPaddr.Text = R.Fields(2).Value
txtNOM.Text = R.Fields(3).Value
End If
End Sub
Recent Posts
Posted on 2019-07-18
Posted on 2019-07-18
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-07-17
Posted on 2019-05-28
Posted on 2019-05-24
Posted on 2019-05-24
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23
Posted on 2019-05-23