The code runs - I can step through each line and watch it. However, it doesn't recognize any row in the listbox as being selected. I even tried putting this code in the After_Update sub, but the same results.
This code works, btw:
Code:
Private Sub lstPartsInSelectedSow_DblClick(Cancel As Integer)
Dim i As Integer
Dim pRcd As Long
Dim sRcd As Long
For i = 1 To Me.lstPartsInSelectedSow.ListCount - 1
If Me.lstPartsInSelectedSow.selected(i) Then
sRcd = Me.lstPartsInSelectedSow.Column(0, i)
pRcd = Me.lstPartsInSelectedSow.Column(4, i)
Debug.Print "sRcd = " & sRcd
myVar = i
End If
Next i
DoCmd.OpenForm "frmEditSowParts", , , "sowId = " & sRcd & " AND tblParts.pRecordId = " & CLng(pRcd)
End Sub