R
ReportSmith
I've read all of the other posts and they've been very helpful, but I'm still
stuck.
I have a form frmMain, a list box (lstParticipant) with Multi Select set to
"Extended", and a text box (hidden) that contains my select statement:
......
Set frm = Forms!frmMain
Set ctl = frm!lstParticipant
strSQL = "SELECT [Participant] FROM [qryABC] WHERE [Participant]= " & """"
For Each varItem In ctl.ItemsSelected
strSQL = strSQL & ctl.ItemData(varItem) & """" & " OR [Participant]=
" & """"
Next varItem
strSQL = Left$(strSQL, Len(strSQL) - 20)
txtParameter = Trim(strSQL) 'I know this is extra
......
in addition, I have the following code to be able to pass this sql string to
the query...
......
Private Sub txtParameter_AfterUpdate()
Me.txtParameter = lstParticipant.Column(0)
End Sub
......
Within my query, I have the field [Participant] with the citeria grid entry
of [forms]![frmMain]![txtParameter]
For a single selection, I can get it to work, for multiple - no can do.
Another question is: should I be looking at the query in "SELECT
[Participant] FROM [qryABC] WHERE [Participant]= " & """" (it seems to be a
recursive call) or change [qryABC] to the original table name?
I've changed the code so many times that it may not be exactly what will
work for the single criterion, but any help would be greatly appreciated.
stuck.
I have a form frmMain, a list box (lstParticipant) with Multi Select set to
"Extended", and a text box (hidden) that contains my select statement:
......
Set frm = Forms!frmMain
Set ctl = frm!lstParticipant
strSQL = "SELECT [Participant] FROM [qryABC] WHERE [Participant]= " & """"
For Each varItem In ctl.ItemsSelected
strSQL = strSQL & ctl.ItemData(varItem) & """" & " OR [Participant]=
" & """"
Next varItem
strSQL = Left$(strSQL, Len(strSQL) - 20)
txtParameter = Trim(strSQL) 'I know this is extra
......
in addition, I have the following code to be able to pass this sql string to
the query...
......
Private Sub txtParameter_AfterUpdate()
Me.txtParameter = lstParticipant.Column(0)
End Sub
......
Within my query, I have the field [Participant] with the citeria grid entry
of [forms]![frmMain]![txtParameter]
For a single selection, I can get it to work, for multiple - no can do.
Another question is: should I be looking at the query in "SELECT
[Participant] FROM [qryABC] WHERE [Participant]= " & """" (it seems to be a
recursive call) or change [qryABC] to the original table name?
I've changed the code so many times that it may not be exactly what will
work for the single criterion, but any help would be greatly appreciated.