On May 16, 7:46 pm, lgeastw...@gmail.com wrote:
I have a Report with a listbox that I need to populate with a
rowsource type = valuelist.
The valuelist for each record is a saved SQL string complete with
commas
On my form I can set the valuelist in code.
However on the report open or detail format events I cannot set the
valuelist.
Does anyone know of a way to put the SQL string into the rowsource
property of the listbox on the report?
Thanks
Ok, I got it. One way anyway. It's from a post I read. Sorry, can't
remember who to credit.
I append to a temp table "tblRowSrc" which I use for the rowsource of
my listbox
It works fine. I attached code below for anyone interested.
varStr = Me.txtString
Do Until varStr = ""
varInt = InStr(varStr, ",")
If varInt = 0 Then
varRec = varStr
varStr = ""
Else
varRec = Left(varStr, varInt - 1)
varStr = Mid(varStr, varInt + 1)
End If
DoCmd.RunSQL "INSERT INTO tblRowSrc ( fldRowSource )SELECT'" & varRec
& "';"
Loop