I have a listbox that has the following SQL in a query:
SELECT tblResponsesList.Rspns, tblResponsesList.QstnID
FROM tblResponsesList
WHERE (((tblResponsesList.QstnID)=[Form]![QstnID]));
I want to have it if I return back to the record at some point, the listbox will show all the options and have selected the selected choices that are stored in tblResponses.
I have tried:
For x = 0 To ListRspns.ListCount - 1
If ListRspns.ItemData(x) = DLookup("Rspns", "tblResponses", "QstnID=" & Me!QstnID) Then
ListRspns.Selected(x) = True
End If
Next x
However, for some reason this is not working. Thoughts? Could it be because I have 2 columns in my listbox (Rspns and QstnID)?
SELECT tblResponsesList.Rspns, tblResponsesList.QstnID
FROM tblResponsesList
WHERE (((tblResponsesList.QstnID)=[Form]![QstnID]));
I want to have it if I return back to the record at some point, the listbox will show all the options and have selected the selected choices that are stored in tblResponses.
I have tried:
For x = 0 To ListRspns.ListCount - 1
If ListRspns.ItemData(x) = DLookup("Rspns", "tblResponses", "QstnID=" & Me!QstnID) Then
ListRspns.Selected(x) = True
End If
Next x
However, for some reason this is not working. Thoughts? Could it be because I have 2 columns in my listbox (Rspns and QstnID)?