I've got a scenario where I've got a listbox with a few records in them. I need to be able to double click a record and pass the id to another form where the corresponding data can be further edited.
I've struggled the whole afternoon with the following piece of code, but can't seem to pick up the return_id from the listbox and filter on that id in the frmReturn_Header form.
At the moment I get a Type Mismatch error.
Hope someone will be able to assist.
I've struggled the whole afternoon with the following piece of code, but can't seem to pick up the return_id from the listbox and filter on that id in the frmReturn_Header form.
Code:
Private Sub lstSearch_DblClick(Cancel As Integer)
On Error GoTo Err_lstSearch_DblClick
Dim db As DAO.Database
Dim rs As DAO.Recordset
DoCmd.OpenForm "frmReturn_Header"
Set rs = Forms!frmReturn_Header.Recordset.Clone
rs.FindFirst "[Return_ID] = " & CInt(Nz([frmReturn_Header_Search]![lstSearch], 0))
Forms!frmReturn_Header.Bookmark = rs.Bookmark
Exit_lstSearch_DblClick:
Exit Sub
Err_lstSearch_DblClick:
MsgBox Err.Description
Resume Exit_lstSearch_DblClick
End Sub
At the moment I get a Type Mismatch error.
Hope someone will be able to assist.