I have currently created a few search fields where the results appear in a listbox. What I am hoping to do is to double click on a specific record in the listbox and have it open up to a form with all the details in it. Currently my code for the listbox is:
Private Sub lstMSDNInfo_DblClick(Cancel As Integer)
'Open frmMSDN based on the ID from lstMSDNInfo listbox
DoCmd.OpenForm "frmMSDN", , , "ID = " & Me!lstMSDNInfo, , acDialog
End Sub
When I run it, it just gives me a syntax error The OpenForm action was cancelled. When i debug it it takes me to:
DoCmd.OpenForm "frmMSDN", , , "ID = " & Me!lstMSDNInfo, , acDialog
Any ideas of what I am doing wrong? I know it's something really simple that I'm missing but I've been over it several hundred times and I can't find anything wrong with it. Any help would be greatly appreciated
Cheers
Private Sub lstMSDNInfo_DblClick(Cancel As Integer)
'Open frmMSDN based on the ID from lstMSDNInfo listbox
DoCmd.OpenForm "frmMSDN", , , "ID = " & Me!lstMSDNInfo, , acDialog
End Sub
When I run it, it just gives me a syntax error The OpenForm action was cancelled. When i debug it it takes me to:
DoCmd.OpenForm "frmMSDN", , , "ID = " & Me!lstMSDNInfo, , acDialog
Any ideas of what I am doing wrong? I know it's something really simple that I'm missing but I've been over it several hundred times and I can't find anything wrong with it. Any help would be greatly appreciated
Cheers