473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Show list box selections in text box on report

31
Hi All.

I have a form where I can select multiple CustomerID's for my report. At the top of the report I have a text box that I would like to disply the Customer ID's that the user selected

This is what I have for the text box

="Customer ID: " & Forms.frm_AllCust.Customer

This code doesn't return anything on the report, just shows "Customer ID: " (shown without the "")


Any help would be great
Oct 11 '10 #1
4 4907
ADezii
8,834 Expert 8TB
Are the Multiple CustomerIDs on frm_AllCust displayed in a List Box named Customer? If so, what is the RowSource for the List Box? You must be more specific as to where and how these IDs are displayed on the Form.
Oct 11 '10 #2
BarbQb
31
Sorry about that.

List box and the rowsource:

frm_AllCust.Customer

Expand|Select|Wrap|Line Numbers
  1. SELECT qryCustomer.Customer_ID 
  2. FROM qryCustomer 
  3. ORDER BY [Customer_ID];
Oct 11 '10 #3
ADezii
8,834 Expert 8TB
From the Report's Activate() Event, you can actually build a String (Comma Delimited in this case) of CustomerIDs Selected on frm_AllCust, then display it in a Text Box (txtIDs) in the Report's Header Section, as in:
Expand|Select|Wrap|Line Numbers
  1. Private Sub Report_Activate()
  2. Dim lst As Access.ListBox
  3. Dim varItem As Variant
  4. Dim strBuild As String
  5.  
  6. Set lst = Forms![frm_AllCust]![Customer]
  7.  
  8. If lst.ItemsSelected.Count > 0 Then
  9.   For Each varItem In lst.ItemsSelected
  10.     strBuild = strBuild & lst.ItemData(varItem) & ","
  11.   Next varItem
  12.     Me![txtIDs] = Left$(strBuild, Len(strBuild) - 1)
  13. End If
  14. End Sub
Oct 11 '10 #4
NeoPa
32,556 Expert Mod 16PB
ADezii, you've changed your avatar again!! I'm struggling to keep up :-D

As for the problem, there is another way to approach this if you assume that the report has already been called with the WhereCondition parameter set to list the relevant [Customer ID]s. The Filter property of the report will contain something like :
Expand|Select|Wrap|Line Numbers
  1. [Customer ID] In(X, Y, Z, ...)
Simply strip the "[Customer ID] In(" and the ")" from the string and add it into the TextBox control displaying the title.
Oct 11 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: NotGiven | last post by:
I'd like to have several levels of field selection. For example, field one has three choices. Once you choose on form field one, several selections show in field based that ARE BASED ON your...
2
by: nikou_70 | last post by:
I have a page with one text box when I search name, return value such as (address, phone...) I show these value in the table but I want to show these in text box that I have in my page. ...
0
by: kujahleague | last post by:
Dear all Is there any way to show list of filename that we have on that current directory to the user? Thanks
1
by: lantamer | last post by:
Hi I need to make script that creates drop-down list from text file (new line in text file – new line in drop-down list). Somebody told me that I should use Ajax and XMLHttpRequest for that, so I...
0
by: refv8 | last post by:
Hi i want to do a list of all Report that i have in a specific folder in the Report server (this is en different server where is the DB) and i want to show this list of report in a page. for...
2
by: David | last post by:
I have VB6 app that generates a report using the Printer object. It basically was an old text report that i generated using Print# statements. I am wondering if the Printer object has changed...
1
by: peterkennett | last post by:
OK, I’m new to all this, so forgive me if I missed some easy answer to this problem! I have a report, which is actually going to be a letter. I had no problem adding my return address, salutation...
2
by: mahesh123 | last post by:
Hi Folks, I am generating the text reports from the visual basic 6.0. while printing the text report the Char(12) ie page break character is not recognising. Is there any alternate Solution for...
0
by: mpathfinder | last post by:
hi guys . sorry for my weak Eng. writing . I want to design a component that in one of it's properties i'd able to collect list of controls of the windows form that hosts this component in a...
12
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...

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.