dbTalk Databases Forums  

List Box Multiple Selections Generating Reports

comp.databases.ms-access comp.databases.ms-access


Discuss List Box Multiple Selections Generating Reports in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
jeffgeorge
 
Posts: n/a

Default List Box Multiple Selections Generating Reports - 12-01-2004 , 03:13 PM






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?

Reply With Quote
  #2  
Old   
Scott Simonson
 
Posts: n/a

Default Re: List Box Multiple Selections Generating Reports - 12-01-2004 , 04:33 PM






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" <kilgore93 (AT) aol (DOT) com> wrote

Quote:
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?



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.