I need help figuring out what I'm doing wrong here.
I've created a form called frmAnalystsReviews( Main form on the right) and added a subform called qryMonthlyReviewsSUBFORM (on the left). The subform is just a continuous form of the frmAnalystReviews form. Users will use the single form for data entry. Both forms are connected by the field called IPIP. Under a specific IPID, we can find multiple records. Each record has a unique LOADID. Users want to be able to double click on any record on the subform, and have the single form points to the corresponding LOADID and keep that LOADID selected or highlighted. Currently, the tool is doing that except that the cursor is going back to the first row of the subform list. I'm unable to create the procedure at the subform detail level, I've created that for each control of the subform. Attached are both procedure and screenshot of the forms. I hope my explanation makes. If not feel free to ask questions.
Thank you
I've created a form called frmAnalystsReviews( Main form on the right) and added a subform called qryMonthlyReviewsSUBFORM (on the left). The subform is just a continuous form of the frmAnalystReviews form. Users will use the single form for data entry. Both forms are connected by the field called IPIP. Under a specific IPID, we can find multiple records. Each record has a unique LOADID. Users want to be able to double click on any record on the subform, and have the single form points to the corresponding LOADID and keep that LOADID selected or highlighted. Currently, the tool is doing that except that the cursor is going back to the first row of the subform list. I'm unable to create the procedure at the subform detail level, I've created that for each control of the subform. Attached are both procedure and screenshot of the forms. I hope my explanation makes. If not feel free to ask questions.
Thank you
Code:
Private Sub Acct_Nbr_DblClick(Cancel As Integer)
Dim LoadIDValue As Variant
Dim rs As Recordset
' Get the LoadID value from the subform
LoadIDValue = Me.LoadID
' Set the recordset of the "frmAnalystReviews" form
Set rs = Forms("frmAnalystReviews").RecordsetClone
' Find the matching record based on LoadID in the recordset
rs.FindFirst "[LoadID] = " & LoadIDValue
' Save the current record's Bookmark
Dim currentBookmark As Variant
currentBookmark = rs.Bookmark
' Set the focus to the "frmAnalystReviews" form
Forms("frmAnalystReviews").SetFocus
' Restore the cursor to the LoadID of the double-clicked record
Forms("frmAnalystReviews").Recordset.Bookmark = currentBookmark
End Sub
Attachments
Last edited by a moderator: