I've tried that. No matter what line I click on, it always returns the value from Me.txtOrder from the first record listed. It only does this in the subform. If I open the subform in form view, it returns the value of me.txtOrder for whatever record I select.
Thanks guys. I've tried both ways with the same result. Also, yes I do have Option Explicit set in that module. There was a typo in the code I posted (should have been "OrderID =" & myOrder)
I have a form that displays details for a specific asset and a continuous subform that lists all the purchases for that asset. I have the following code in the On Click event for one of the fields in the subform:
Dim myOrder As Integer
myOrder = Me.txtOrder
DoCmd.OpenForm "frmOrders"...