G
Guest
I'm trying to use the following function as criteria in a query, but I get no results
If I plug the results of the function into the query it works just fine, but I would like this to be dynamic. Any questions
Thank
Public Function CategoryFields(Separator As String) As Strin
Dim frm As For
Dim ctl As Contro
Dim intCurrentRow As Intege
Set frm = Form_frmDT
Set ctl = frm.lstSelCa
For intCurrentRow = 0 To frm.lstSelCat.ListCount -
CategoryFields = CategoryFields & Chr(34) & ctl.Column(0, intCurrentRow) & Chr(34) & Separato
Next intCurrentRo
CategoryFields = Left(CategoryFields, Len(CategoryFields) - Len(Separator)
Set ctl = Nothin
Set frm = Nothin
End Function
If I plug the results of the function into the query it works just fine, but I would like this to be dynamic. Any questions
Thank
Public Function CategoryFields(Separator As String) As Strin
Dim frm As For
Dim ctl As Contro
Dim intCurrentRow As Intege
Set frm = Form_frmDT
Set ctl = frm.lstSelCa
For intCurrentRow = 0 To frm.lstSelCat.ListCount -
CategoryFields = CategoryFields & Chr(34) & ctl.Column(0, intCurrentRow) & Chr(34) & Separato
Next intCurrentRo
CategoryFields = Left(CategoryFields, Len(CategoryFields) - Len(Separator)
Set ctl = Nothin
Set frm = Nothin
End Function