Can anyone tell me if this can be done:
I have a function opening a form and passing a selected record by a click in a listbox and also want the enter/return key to do the same function. the code used is below (some may recogise bits of it)
any pointers?
Private Sub lstResults_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FRMmembers editor"
stLinkCriteria = "[ID]=" & Me![lstResults]
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub
I have a function opening a form and passing a selected record by a click in a listbox and also want the enter/return key to do the same function. the code used is below (some may recogise bits of it)
any pointers?
Private Sub lstResults_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "FRMmembers editor"
stLinkCriteria = "[ID]=" & Me![lstResults]
DoCmd.Close
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Sub