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

List Box Multiple Selections Generating Reports

P: n/a
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
Share this Question
Share on Google+
1 Reply


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