By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,480 Members | 767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,480 IT Pros & Developers. It's quick & easy.

Report Listbox

P: n/a
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

May 17 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On May 16, 8: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
A listbox in a report? Hmmmm...

May 17 '07 #2

P: n/a
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

May 17 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.