473,326 Members | 2,111 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,326 software developers and data experts.

Generate String and output to textbox in report

I am new to access, so please excuse ignorance. Within my table
(contacts) I have a text field (other). What I am trying to do is
collect all of the text input from the field 'other', separate each
string by commas, and output to a single textbox on my report
(othertext). Normally...I would go in and clean up the data or assign
numbers to the text values, but in this instance that is counter
productive. Can anyone help me with code to generate a string and then
output it to a single text box in my report?

Many thanks in advance!

Brooke

Nov 13 '05 #1
3 2534
Brooke wrote:
I am new to access, so please excuse ignorance. Within my table
(contacts) I have a text field (other). What I am trying to do is
collect all of the text input from the field 'other', separate each
string by commas, and output to a single textbox on my report
(othertext). Normally...I would go in and clean up the data or assign
numbers to the text values, but in this instance that is counter
productive. Can anyone help me with code to generate a string and then
output it to a single text box in my report?

Many thanks in advance!

Brooke


Look up concatenation in Help.

Answer = Other1 & ", " & Other2

Ron

Nov 13 '05 #2
That would work if I was using two seperate fields...and wanting to
join them together. Sorry if I wans't clear. I have a table where users
enter text in a text field. Each user's entry is stored as an entry in
my table...under the same field name. What I am trying to do is take
all of the data that was ever entered into that one field, and spit it
out to a single text box in a form. Right now, my report will display
data from the table, but creates new reports for each instance of data
in the 'other' field. I need all instances on one report.

Thanks though!

Nov 13 '05 #3
oh, in that case, you have to use code to do it.

Public Function DelimitedListOfValues(ByVal strTable As String, ByVal
strField As String) As String
Dim strTemp As String
Dim rs As DAO.Recordset

Set rs = DBEngine(0)(0).OpenRecordset("SELECT [" & strField & "]
FROM " & strTable & " ORDER BY [" & strField & "];")
Do Until rs.EOF
strTemp = strTemp & rs.Fields(strField) & ", "
rs.MoveNext
Loop

strTemp = Left$(strTemp, Len(strTemp) - 2)

rs.Close
Set rs = Nothing

DelimitedListOfValues = strTemp
End Function

Then you'd have to call the function in the rowsource for your unbound
textbox on your report. (too many prepositional phrases in that!!!
PHew!)

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Tran Tuan Anh | last post by:
Dear all: I need your advice on this matter. I am working on a program which takes some pieces of System-C code in and generate some other System-C code. (System-C code is just C++ with some...
4
by: k.mitz | last post by:
Hi, I have a PHP application that allows users to generate a .pdf report of their database content. Normally, I've had to refresh a page to call the script to generate the report, so there's a...
2
by: PeterW | last post by:
I have an xml file from which I want to generate an xsd schema and at a later stage a cs class. The xml file has a mix of defined namespaces and also an empty namespace. These are defined as...
3
by: amywolfie | last post by:
Hi All: I would like to run a report based on criteria from 3 unbound combo boxes located on a parameter form (combo boxes are: cboCuisine, cboLocation, and cboRestaurant) The present code...
4
by: Andrew | last post by:
My VB Application opens an Access Report and has an option to generate the report in PDF once the report is closed. This is accomplished by: - Switching over to the Acrobat Printer (i.e....
2
by: scott.k.fraley | last post by:
....and the SELECT thats trying to pull from said Query doesn't like it one bit! ;) I'm working on this project (in Access 2002) and there is a report who's RecordSource is the following...
0
by: ward | last post by:
Greetings. Ok, I admit it, I bit off a bit more than I can chew. I need to complete this "Generate Report" page for my employer and I'm a little over my head. I could use some additional...
21
by: Grant Edwards | last post by:
I need to be able to generate a PDF report which consists mostly of vector images (which I can generate as encapsulated Postscript, PDF, or SVG). What I need is a way to combine these figures...
2
by: ssmith147 | last post by:
Hi, I'm somewhat familiar with access and vb programming (I can read someone else's code, for the most part), but I'm still very green when it comes to creating solutions for my own needs. I'm...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.