Go to record from list box

Maestro

Registered User.
Local time
Today, 10:54
Joined
Jun 16, 2001
Messages
21
I have a form based on a table containing records about members of a society. On the form I have an unbound list box that draws information from a query (to list members whose membership has lapsed), with 'ID' being the bound field. I want to be able to set things up so that when I click one of the members listed in that list box the form jumps to that members' record. Any thoughts on how to achieve this?
 
Private Sub lstFound_DblClick(Cancel As Integer)
On Error GoTo Err_lstFound_DblClick

Dim strFormName As String

strFormName = "MyForm"

DoCmd.OpenForm strFormName, , , "[MyID] = " & Me!lstFound


Exit_lstFound_DblClick:
Exit Sub

Err_lstFound_DblClick:
MsgBox Err.Description
Resume Exit_lstFound_DblClick

End Sub
 
Perfect!

Thanks.
 

Users who are viewing this thread

Back
Top Bottom