I've looked around and seen a number of questions on this topic, but none of them quite get me where I want to go.
I have a master form called "frmDataEntry" and the primary key is a string field called "numStudy" and does include both letters and numbers.
I have several forms which point back to this master form, and I want to be able to have them open frmDataEntry to the same record they are currently on. I also want the same routine to close the form we're navigating away from.
This code has gotten me really close:
It works if the form frmDataEntry is ALREADY open. If that form is NOT open when I press the button, it takes me to the first record in the set.
I'm so close - can anyone push me over the top?
Rob
I have a master form called "frmDataEntry" and the primary key is a string field called "numStudy" and does include both letters and numbers.
I have several forms which point back to this master form, and I want to be able to have them open frmDataEntry to the same record they are currently on. I also want the same routine to close the form we're navigating away from.
This code has gotten me really close:
Code:
Private Sub btnEdit_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stLinkCriteria = "numStudy = '" & Me.numStudy & "'"
stDocName = "frmDataEntry"
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
It works if the form frmDataEntry is ALREADY open. If that form is NOT open when I press the button, it takes me to the first record in the set.
I'm so close - can anyone push me over the top?
Rob
Last edited: