Question : Go to a specific Record in a popup form from a record listed in an open form/subform

I have a form (SingleForm) and within it I have a subform as continuous (one to many).  After I click on a button I have a popup form that opens but I want it to go to a specific record based on what record I have actively selected on my subform.  So on my subform I have 10 records and I have at this moment my cursor on record 7.  I like the pop form when it opens go to record 7 of that form (which is a main form as it has some embedded information)

The code is an idea and show on the right side the path to the field I SupplyInventoryID that is common between the continuous subform and the popup form.  Shoudl mention it MS Access front end with a SQL Backend
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
Private Sub Form_Open(Cancel As Integer)
 
 ' Find the record that matches the control.
    Dim rs As Object
 
   Set rs = Me.Recordset.Clone
   rs.FindFirst "[SupplyInventoryId] = " [Forms![frm_Chemical]![frm_ChemicalStorageSupplyLocation subform].Form![SupplyInventoryId]],)
    If Not rs.EOF Then Me.Bookmark = rs.Bookmark
        
End Sub

Answer : Go to a specific Record in a popup form from a record listed in an open form/subform

Try this:

stLinkCriteria = "[SupplyInventoryId]=" & Me![frm_ChemicalStorageSupplyLocation subform].Form![SupplyInventoryId]

The WHERE argument of the OpenForm method should be, basically, a WHERE clause without the word WHERE ...
Random Solutions  
 
programming4us programming4us