Hello! I have created a form in my database that allows a user to enter notes. This form is access through another form (Edit Client Data). I have an "Add Notes" button which opens the Notes form in a pop up menu. I have entered an OnClose Event using the Requery function to refresh a subform I have created to display all Client Notes. Upon closing the Notes Form, the Edi Client Data Form is displayed however it refreshes to the first record in my RecordSet and not the record it was previously on. For example:
Client ABCDEF is the first record in my record set. I have opened the Edit Client Data form for Client 12345. I click "Add Note" to add a note for Client 12345. Once I close/save the Notes Screen I am returned to the Edit Client Data Screen for Client ABCDEF rather than Client 12345.
Client ABCDEF is the first record in my record set. I have opened the Edit Client Data form for Client 12345. I click "Add Note" to add a note for Client 12345. Once I close/save the Notes Screen I am returned to the Edit Client Data Screen for Client ABCDEF rather than Client 12345.
I am using Access 2016.
I am pulling my hair out trying to figure out what is going on. Below is the code for the "Add Note" Save/Close function
Code:
Private Sub Command464_Click()
If IsNull(Me.cbo_ClientName) Then
MsgBox "PLEASE ENTER CLIENT NAME", vbExclamation, "DATA REQUIRED!"
Me.cbo_ClientName.SetFocus
Exit Sub
End If
If IsNull(Me.Text460) Then
MsgBox "PLEASE ENTER DATE", vbExclamation, "DATA REQUIRED!"
Me.Text460.SetFocus
Exit Sub
End If
If IsNull(Me.Text465) Then
MsgBox "PLEASE ENTER CLIENT NOTES", vbExclamation, "DATA REQUIRED!"
Me.Text465.SetFocus
Exit Sub
End If
DoCmd.Close
DoCmd.OpenForm "Master_ManAcc_Form_EDIT_Client_Data"
End Sub
Thanks!
Private Sub Form_Close()
Forms!Master_ManAcc_Form_EDIT_Client_Data.Requery
End Sub
Forms!Master_ManAcc_Form_EDIT_Client_Data.Requery
End Sub