I use the OnClick or OnDoubleClick event of the listbox and do something like:
CODE
Private Sub lboMenu_Click()
On Error GoTo Err_lboMenu_Click
Dim stLinkCriteria As String
Dim stDocName As String
stLinkCriteria = "[id]=" & Me.lboMenu.Column(2) & ""
stDocName = "frmComplete"
DoCmd.OpenForm stDocName, , , stLinkCriteria
DoCmd.Close acForm, "frmMenu"
Exit_frmMenu_Click:
Exit Sub
Err_frmMenu_Click:
MsgBox Err.Description
Resume Exit_frmMenu_Click
End Sub
This basically opens the form where "id" equals the [id] value in column 2 of my listbox. You can set it to open using the data from any column.
If your data is text then you need single quotes around your listbox value, ie:
"[UserName]=
'" & Me.lboMenu.Column(2) & "
'"
Or if it's a date then the quotemarks should be '#'.
Hope that helps!
Becki