Hello all,
Yet another question of many to come, lol.
I have a listboxA on formA and a listboxB on formB. When the user clicks an item in listboxA and then presses the view record I want formB to open and the item selected in listboxA should select the same record in listboxB.
This is the code I have:
This code works great from listboxA to formB for textboxes, but I cant get it to select any item in lstboxB. I have tried various combinations, but to no avail.
Yet another question of many to come, lol.
I have a listboxA on formA and a listboxB on formB. When the user clicks an item in listboxA and then presses the view record I want formB to open and the item selected in listboxA should select the same record in listboxB.
This is the code I have:
Code:
Private Sub cmdSearchSelect_Click()
'opens form to record selected in listbox
On Error GoTo Err_cmdSearchSelect_Click
Dim strDocName As String
Dim strLinkCriteria As String
strDocName = "CWRDefinitions"
strLinkCriteria = "lstCWR.Column(0) ='" & Me![SearchResults].Column(0) & "'"
DoCmd.OpenForm strDocName, , , strLinkCriteria
Exit_cmdSearchSelect_Click:
Exit Sub
Err_cmdSearchSelect_Click:
MsgBox Err.Description
Resume Exit_cmdSearchSelect_Click
End Sub
This code works great from listboxA to formB for textboxes, but I cant get it to select any item in lstboxB. I have tried various combinations, but to no avail.