Ok, here's the deal. I have an unbound list box that is displaying the results of a Query on my main table of data. This data can easily be browsed in tabular form by the users.
When the user double-clicks on an item from the list box, I have an event procedure that pops up detailed information for that item. What I need to know is how to determine what item has been selected within the unbound list box. From that selection, I need to extrapolate the ID number to compare it to the IDs from the detailed info.
With this information, I can open the detailed information window up to the correct record. I would prefer a VBA solution to the problem.
Here's what I have and what I need:
Private Sub List18_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "View_Edit_Action_Item"
stLinkCriteria = "[ID]=" & "'" & Me![ID] & "'" <-- This is wrong, because it defaults to the ID that is selected by the whole form, rather than the selection within the unbound list box
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Subwhole form
A little help with that LinkCriteria line would be much appreciated!
Jess
When the user double-clicks on an item from the list box, I have an event procedure that pops up detailed information for that item. What I need to know is how to determine what item has been selected within the unbound list box. From that selection, I need to extrapolate the ID number to compare it to the IDs from the detailed info.
With this information, I can open the detailed information window up to the correct record. I would prefer a VBA solution to the problem.
Here's what I have and what I need:
Private Sub List18_DblClick(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "View_Edit_Action_Item"
stLinkCriteria = "[ID]=" & "'" & Me![ID] & "'" <-- This is wrong, because it defaults to the ID that is selected by the whole form, rather than the selection within the unbound list box
DoCmd.OpenForm stDocName, , , stLinkCriteria
End Subwhole form
A little help with that LinkCriteria line would be much appreciated!
Jess