Command Button to Open form from different record in MS Access 2007

I have a multi-record form in Access 2007 with a command button at end of the line. The current record could be the first for instance but I want to click on the button on the 4th record (without actually having to go into record) and open a form with info related to 4th record. Currently it brings up info related to 1st record because the cursor was in a field on that 1st record. When I click on the button on the 4th record it still seems to think its on the first record. My code is:

Dim stDocName As String DoCmd.OpenForm stDocName, , , "WorkAddressId = forms!Persons!WorkAddressId" 
4,887 1 1 gold badge 49 49 silver badges 56 56 bronze badges asked Apr 21, 2016 at 9:57 5 3 3 bronze badges

How does the command button on row 1 differ from row 4? How does it know which row it is on? You're referencing [WorkAddressId], where is that control? Do you have [WorkAddressid1], [WorkAddressid2] . [WorkAddressid4]?

Commented Apr 21, 2016 at 13:05 Command button is on every line at end of the fields Commented Apr 21, 2016 at 16:55

Ok is [WorkAddressId] one of the controls on each line, or is there just one on the form that's changing value when you make selections? Based on your answer I should be able to solve.