Hi Everybody,
I need to concatenate all records on one field as one line.
Example: Field 1 has 50 records, record1, record2 to record50. I need to display an output in Text that read as:
record1,record2,record3,record4,record5,record6..r ecord50
No space and no line breaks.
I tried creating a report and replace vbCrLf with "" and then OutputTo text file
but I can't have it to have only only 1 line with now line breaks.
All help is appreciated.
thanks.
1 2001
Hi Everybody,
I need to concatenate all records on one field as one line.
Example: Field 1 has 50 records, record1, record2 to record50. I need to display an output in Text that read as:
record1,record2,record3,record4,record5,record6..r ecord50
No space and no line breaks.
I tried creating a report and replace vbCrLf with "" and then OutputTo text file
but I can't have it to have only only 1 line with now line breaks.
All help is appreciated.
thanks.
Assuming your Table Name is tblTest, I created this code for a series of 50 Numbers (50 Records) in a Field named Field1: -
Dim MyDB As DAO.Database, MyRS As Recordset, strBuild As String
-
-
Set MyDB = CurrentDb
-
Set MyRS = MyDB.OpenRecordset("tblTest", dbOpenForwardOnly)
-
-
Do While Not MyRS.EOF
-
strBuild = strBuild & MyRS![Field1] & ","
-
MyRS.MoveNext
-
Loop
-
-
strBuild = Left$(strBuild, Len(strBuild) - 1) 'remove trailing ,
-
-
Open "C:\BigString.txt" For Output As #1
-
Print #1, strBuild
-
-
MyRS.Close
-
Set MyRS = Nothing
-
-
Close #1
OUTPUT: (won't Format correctly) - 65328,98763,104084,105688,106755,109410,109471,113047,113062,115333,118480,118487,118509,120426,123309,126184,129286,129342,129362,129369,135984,136274,136284,136306,138280,138286,138293,138328,138344,138349,138357,138358,138365,140432,140435,140459,140468,140479,140486,143019,143027,143043,144793,144794,144798,144803,144810,144814,144835,146336
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Chris Kettenbach |
last post by:
Good Morning,
Sorry for xposting. Just need a liitle help.
I have an xml file that's generated from a database. How do I select
distinct values from a field in xslt and then loop through the...
|
by: gwarning! |
last post by:
Goal: Have multiple text files, each of various lengths, be
concatenated together into one final consolidated text file.
Problem: Since the names of the files to be concatenated can change
from...
|
by: Dixie |
last post by:
I have the results of a query to send to a mailmerge with Word 2000. The
query produces say 6 to 8 records, where only 1 of the fields is different
from record to record. I can only have one...
|
by: jpr |
last post by:
hello,
I have a form with four fields: Fname, Lname, DOB and txtresult.
Examples: JOHN, SMITH, 03/19/2006.
The first three are bound to a table while the txtresult is unbound.
I would...
|
by: ffimbel |
last post by:
Hi,
I would like to find out the fastest way to concatenate large (200 or
300MB) and numerous (500 - 700) files (Postscript files) into a single
one (which can ends up being several GigaB)...
|
by: Dan |
last post by:
Hi all, I am creating a search table where the keywords field is made
up of several text fields and this is causing me some problems. I can
concatentate the text ok but i can't seem to concatenate...
|
by: drazenj |
last post by:
Hi , sorry for my english ...
I work in high school as a teacher and try to make CLASS SCHEDULE (TIME schedule) for my collegues and for students .
My problem is that I don't know how to...
|
by: jrheltmach |
last post by:
Hi All, have a question I hope someone can help me out with. I have a
file from our financial application here at work that creates
invoices. In it, it pulls data from our SQL Server 2000...
|
by: Aaron Hoffman |
last post by:
Hello,
I'm hoping someone might be able to offer some guidance to my problem.
I have one query in MS Access which consists of 2 tables joined by a
SEQUENCE_ID. By joining the two tables I am...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
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...
|
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)...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
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
|
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...
| |