473,834 Members | 2,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3091
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.ListCoun t - 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.OpenRepor t "Manifest Multiple", pvType, , pvWhere
End if

HTH...

Scott

"jeffgeorge " <ki*******@aol. com> wrote in message
news:4f******** *************** ***@posting.goo gle.com...
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
8604
by: Jillian Cee | last post by:
I have a multiselect list box (simple). I need to find out how to get Access to recognise my multiple selections firstly (I believe) then I want these selections to go into a query so that I can print a report based on these multiple selections from my list box. I am not very good at coding, and want to advoid it if possible. Many thanx. Regards, Jillian
0
3520
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list boxes do not necessarily need to have a selection made to be used in the dynamic query. In essence the form can have selections made in all or none of its list boxes to form the dynamic query I am looking to get some feedback in reference to...
6
4902
by: Joe | last post by:
I have 2 multi-list boxes, 1 displays course categories based on a table called CATEGORIES. This table has 2 fields CATEGORY_ID, CATEGORY_NAME The other multi-list box displays courses based on a table called COURSES. This table has 2 fields CATEGORY_ID, COURSE_NAME. The CATEGORY_ID is a FK in COURSES and a PK in CATEGORIES. I want to populate the course list box based on any category(s)
4
2359
by: Onion | last post by:
This has to be simple, but I'm forced to admit that I'm a novice who can't figure it out. I have a listbox in a form that allows multiple selections. That works fine. The problem: I can't figure out how to store the data. I want to store the items chosen from the listbox in a field for the current record. That means the table field must store the variable number of text items selected from the listbox by the user.
3
2893
by: syounger | last post by:
Hi. I have a report in Access 2000 that is based on selection made from a series of interdependent list boxes. The boxes I have right now are Source, Table, Column, Date. The user chooses Source first, then the Table list box populates only tables from that source. Once a table is chosen, only the columns for that table appear in the Column list box. In the date box, the only dates that appear are those that are stored against the...
2
6827
by: bienwell | last post by:
Hi all, I've got a problem with getting the data values from multiple selections in the list box. I could only get the value and the index of the first item from the selection, but not the others. The data loaded for the Listbox (FieldList) is from data table. I already set the property SelectionMode="Multiple" for the FieldList . Users perform multiple selections from the list box. The event to get the value is in the Button_Click. ...
4
2872
by: tbayse | last post by:
Hello, I have a question about making multiple selection queries in Access. I am running windows XP and Access 2003. Up until this point I had a form where a user would make single selections from a combo box and the following combo box would filter based on the initial selection. I now would like to give the opportunity to make multiple selections and the following combo box would filter based on that. How do I go about declaring this...
12
4052
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just not several, to report using this code i found - Private Sub cmdPreview_Click()
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9643
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10789
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10504
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10544
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9327
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7755
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5790
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.