Hello there, I am trying to switch the record selected on my main form to the one which has been selected in a sub form datasheet. Such that, as the user selects a record in the subform it will identify the Primary Key field and use that to change the record displayed in the main form.
Below is the code I currently have.
Private Sub Form_Current()
If Not IsNull(Me.Student_Name) Then
Dim RecordValue As String
MsgBox Me.Student_Name 'Only used to test the value returned'
'DoCmd.GoToRecord acDataForm, "Student", acGoTo, Me.Student_Name
End If
Currently the retrieval of the PK(Student Name) works perfectly, i just need to be able to now change the record displayed on the main form.
Any help will be greatly appreciated.
Below is the code I currently have.
Private Sub Form_Current()
If Not IsNull(Me.Student_Name) Then
Dim RecordValue As String
MsgBox Me.Student_Name 'Only used to test the value returned'
'DoCmd.GoToRecord acDataForm, "Student", acGoTo, Me.Student_Name
End If
Currently the retrieval of the PK(Student Name) works perfectly, i just need to be able to now change the record displayed on the main form.
Any help will be greatly appreciated.