Can anyone help me please.

I want it so when i click on the grid that record shows in the text boxs can someone help using the code below.

VB Code:
  1. Public CN As New ADODB.Connection
  2. Public RS As New ADODB.Recordset
  3.  
  4. Private Sub cmdClose_Click()
  5. CN.Close
  6. Unload Me
  7. End Sub
  8.  
  9. Private Sub cmdDelete_Click()
  10.     With RS
  11.         If MsgBox("Are You Sure?", vbCritical + vbYesNo, "Confirm") = vbYes Then
  12.  
  13.         CN.Execute "DELETE * FROM Subjects WHERE Subject ='" & .Fields("Subject") & "'"
  14.         MsgBox "Deleted", vbInformation, "Deleted"
  15.         .Requery
  16.         End If
  17.     End With
  18. End Sub
  19.  
  20. Private Sub cmdFirst_Click()
  21. On Error Resume Next
  22. With RS
  23.     .MoveFirst
  24. If .EOF = True Then
  25.     .MoveLast
  26. End If
  27.             txtSubject.Text = .Fields("Subject")
  28.             txtNoOfBooks.Text = .Fields("NoOfBooks")
  29.             txtDays.Text = .Fields("IssueDays")
  30.             txtFine.Text = .Fields("Finecharge")
  31.             txtReverse.Text = .Fields("ReserveCharge")
  32. End With
  33.  
  34. End Sub
  35.  
  36. Private Sub cmdLast_Click()
  37. On Error Resume Next
  38. With RS
  39.     .MoveLast
  40. If .EOF = True Then
  41.     .MoveFirst
  42. End If
  43.             txtSubject.Text = .Fields("Subject")
  44.             txtNoOfBooks.Text = .Fields("NoOfBooks")
  45.             txtDays.Text = .Fields("IssueDays")
  46.             txtFine.Text = .Fields("Finecharge")
  47.             txtReverse.Text = .Fields("ReserveCharge")
  48. End With
  49. End Sub
  50.  
  51. Private Sub cmdNew_Click()
  52.     cmdSave.Enabled = True
  53.     txtSubject.Text = ""
  54.     txtNoOfBooks.Text = ""
  55.     txtDays.Text = ""
  56.     txtFine.Text = ""
  57.     txtReverse.Text = ""
  58.     RS.AddNew
  59.  
  60. End Sub
  61.  
  62. Private Sub cmdNext_Click()
  63. On Error Resume Next
  64. With RS
  65.     .MoveNext
  66. If .EOF = True Then
  67.     .MoveFirst
  68. End If
  69.             txtSubject.Text = .Fields("Subject")
  70.             txtNoOfBooks.Text = .Fields("NoOfBooks")
  71.             txtDays.Text = .Fields("IssueDays")
  72.             txtFine.Text = .Fields("Finecharge")
  73.             txtReverse.Text = .Fields("ReserveCharge")
  74. End With
  75.  
  76. End Sub
  77.  
  78. Private Sub cmdPrevious_Click()
  79. On Error Resume Next
  80. With RS
  81.     .MovePrevious
  82. If .EOF = True Then
  83.     .MoveLast
  84. End If
  85.             txtSubject.Text = .Fields("Subject")
  86.             txtNoOfBooks.Text = .Fields("NoOfBooks")
  87.             txtDays.Text = .Fields("IssueDays")
  88.             txtFine.Text = .Fields("Finecharge")
  89.             txtReverse.Text = .Fields("ReserveCharge")
  90. End With
  91.  
  92. End Sub
  93.  
  94. Private Sub cmdSave_Click()
  95.  With RS
  96.          If MsgBox("Are You Sure?", vbQuestion + vbYesNo, "Confirm") = vbYes Then
  97.         If RS.EOF Then
  98.             .AddNew
  99.         End If
  100.         If txtSubject.Text <> "" And txtNoOfBooks.Text <> "" And txtDays.Text <> "" And txtFine.Text <> "" And txtReverse.Text <> "" Then
  101.         .Fields("Subject") = txtSubject.Text
  102.         .Fields("NoOfBooks") = txtNoOfBooks.Text
  103.         .Fields("IssueDays") = txtDays.Text
  104.         .Fields("FineCharge") = txtFine.Text
  105.         .Fields("ReserveCharge") = txtReverse.Text
  106.         .Update
  107.         MsgBox "Saved", vbInformation, "Saved"
  108.     End If
  109.    
  110. End If
  111. End With
  112. End Sub
  113.  
  114. Private Sub cmdSearch_Click()
  115. With RS
  116.     .Close
  117.     RS.Open "Select * FROM Subjects WHERE subject ='" & txtSearch.Text & "'"
  118.     txtSearch.Text = .Fields("Subject")
  119.    
  120.     .Requery
  121. End With
  122.  
  123. End Sub
  124.  
  125. Private Sub Command1_Click()
  126. On Error Resume Next
  127. With RS
  128.     If MsgBox("Update The Record?", vbQuestion + vbYesNo, "Confirm") = vbYes Then
  129.     .Fields("Subject") = txtSubject.Text
  130.     .Fields("NoOfbooks") = txtNoOfBooks.Text
  131.     .Fields("IssueDays") = txtDays.Text
  132.     .Fields("FineCharge") = txtFine.Text
  133.     .Fields("ReverseCharge") = txtReverse.Text
  134.     .Update
  135.     .Requery
  136. MsgBox "The current record has been updated", vbInformation, "Update Successful"
  137. End If
  138. End With
  139. End Sub
  140.  
  141. Private Sub Command2_Click()
  142.   If Command2.Caption = "Search" Then
  143.         Command2.Caption = "Stop"
  144.         frmSubjects.Height = 6255
  145.         Frame1.Visible = True
  146.     Else
  147.         Command2.Caption = "Search"
  148.         frmSubjects.Height = 5040
  149.         Frame1.Visible = False
  150.     End If
  151.  
  152. End Sub
  153.  
  154.  
  155.  
  156. Private Sub Command4_Click()
  157. With RS
  158.     .Close
  159.    
  160.     RS.Open "Select * FROM Subjects"
  161.    
  162.     .Requery
  163. End With
  164.  
  165. End Sub
  166.  
  167. Private Sub Form_Load()
  168.     CN.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb"
  169.     RS.CursorLocation = adUseClient
  170.     RS.Open "SELECT * FROM Subjects ORDER BY Subject ASC", CN, adOpenStatic, adLockOptimistic
  171.     Set DataGrid1.DataSource = RS
  172.    
  173.       With RS
  174.         If Not .BOF Then
  175.             txtSubject.Text = .Fields("Subject")
  176.             txtNoOfBooks.Text = .Fields("NoOfBooks")
  177.             txtDays.Text = .Fields("IssueDays")
  178.             txtFine.Text = .Fields("Finecharge")
  179.             txtReverse.Text = .Fields("ReserveCharge")
  180.            
  181.              lblStatus.Caption = "Total Records: " & CStr(RS.RecordCount)
  182.         End If
  183.     End With
  184.  
  185.   DataGrid1.Columns(0).Caption = "Subject"
  186.   DataGrid1.Columns(1).Caption = "Issue Days"
  187.   DataGrid1.Columns(2).Caption = "No Of Books"
  188.   DataGrid1.Columns(3).Caption = "Fine Charge"
  189.   DataGrid1.Columns(4).Caption = "Reverse Charge"
  190. End Sub