Ally
Registered User.
- Local time
- Today, 02:50
- Joined
- Sep 18, 2001
- Messages
- 617
I have a list box that I put some code on the DoubleClick event to open the related record clicked, in another form. I've done it before and it works but for some reason this one is not working and I can't understand why. It opens the correct form, but opens a new record and not the one selected in the list box. (I just wanted to have a list box instead of a subform as it's slightly neater).
(I originally put a command button on a subform, then copied the code across - just changed the bit:
from
I hope this makes sense. Does anyone have any ideas please?
Code:
Private Sub lstEpisode_DblClick(Cancel As Integer)
On Error GoTo Err_lstEpisode_DblClick
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frmEpisode"
stLinkCriteria = "[ITURegNo]=" & "'" & Me![lstEpisode] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_lstEpisode_DblClick:
Exit Sub
Err_lstEpisode_DblClick:
msgbox Err.Description
Resume Exit_lstEpisode_DblClick
End Sub
(I originally put a command button on a subform, then copied the code across - just changed the bit:
Code:
stLinkCriteria ... ... "'" & Me![lstEpisode] & "'"
from
Code:
stLinkCriteria ... ... "'" & Me![ITURegNo] & "'"
I hope this makes sense. Does anyone have any ideas please?
Last edited: