469,927 Members | 1,951 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

List Box Multiple Selections Generating Reports

Trying to create multiple acct reports based on the selection in a
list box. I've set the list box for multiple selections, and in the
report data source, I have a SQL statement which is reading the list
box(when there is a single selection) but no luck with multiple
selections. I'm suspecting I need to write a bit of code using an
array.

Does anyone have any insight or direction on how I might add?
Nov 13 '05 #1
1 2848
Here you go.

'now iterate through selected listbox items and populate private variable
with all boxes to print.
pvWhere = ""
pvCnt = 0
For pvCnt = 0 To lstBox.ListCount - 1
If lstBox.Selected(pvCnt) = True Then
If pvWhere <> "" Then pvWhere = pvWhere & ","
pvmultipleBoxes = pvmultipleBoxes + 1
pvWhere = pvWhere & lstBox.Column(0, pvCnt)
End If
Next pvCnt

'if we have boxes lets print it.
If pvWhere <> "" Then
pvType = acViewPreview
DoCmd.OpenReport "Manifest Multiple", pvType, , pvWhere
End if

HTH...

Scott

"jeffgeorge" <ki*******@aol.com> wrote in message
news:4f**************************@posting.google.c om...
Trying to create multiple acct reports based on the selection in a
list box. I've set the list box for multiple selections, and in the
report data source, I have a SQL statement which is reading the list
box(when there is a single selection) but no luck with multiple
selections. I'm suspecting I need to write a bit of code using an
array.

Does anyone have any insight or direction on how I might add?

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

By using this site, you agree to our Privacy Policy and Terms of Use.