473,748 Members | 2,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Splitting a text field conatining a carriage return.

I have a field in an access 2000 database that is actually three lines
of text separated by carriage returns.

Is there a function in the Access version of SQL that will let me
locate the carriage returns and then split the field based on the
positions of the carriage returns?

Or do I need to process the field with Visual Basic?

I seached for an answer to this on the web. I found an answer that
said to use the CHARINDEX function but that is apparently not a part
of ACCESS 2000 because I get an error message saying that it is
invalid.

Thanks in advance for your help.

Greg Teets
Cincinnati Ohio USA
Nov 13 '05 #1
1 11812
On Thu, 30 Dec 2004 20:06:19 GMT, Greg Teets wrote:
I have a field in an access 2000 database that is actually three lines
of text separated by carriage returns.

Is there a function in the Access version of SQL that will let me
locate the carriage returns and then split the field based on the
positions of the carriage returns?

Or do I need to process the field with Visual Basic?

I seached for an answer to this on the web. I found an answer that
said to use the CHARINDEX function but that is apparently not a part
of ACCESS 2000 because I get an error message saying that it is
invalid.

Thanks in advance for your help.

Greg Teets
Cincinnati Ohio USA


If your version of Access has the Split() function (look it up in VBA
Help), you can use it to parse the field into 3 different parts.
You would use Chr(13) & chr(10) as the field delimiter.

Because this is a VBA function, you'll need to create a module, then
call it from the query.

In a module:

Public Function splitthis(field in, X)
Dim var As Variant
var = Split(fieldin, Chr(13) & Chr(10), -1)
splitthis = var(X)

End Function

In a query:
New:splitthis([FieldName],0)

will get the first part. The parts are Zero based, so the third part
will be
splitthis([FieldName],2)

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2

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

Similar topics

1
1712
by: Mike | last post by:
In my database there is a text field type that is used to enter street address. This address could be a few lines long, each line with a carriage return at the end. Is there a way to search for these carriage returns and break out what is in each line seperately? Thanks. Mike
0
1785
by: raj | last post by:
I have multiline-text box in my C# application. User enter text into the multiline-text box, and without completing the whole line, user press Enter Key and go to the next line, by leaving the '\n'(new line character) in the string. I use this text to write to a database field and then write that field to an excel file. The string is not writing to a single line as it has the carriage return ('\n), wraps the text into the next line in...
8
3438
by: Dave Moore | last post by:
I realize this is a somewhat platform specific question, but I think it is still of general enough interest to ask it here ... if I am wrong I guess I will find out 8*). As we all know, DOS uses two characters (carriage-return and line-feed), to signal the end of a line, while UNIX uses only one (line-feed). When using getline in C++, one can only specify a single character as the terminator (default is '\n'), so if you read a line of...
1
4596
by: chrissmith_76_Fed_Up_With_Spam | last post by:
Hello all, I am using Access 2002, with file format of Access 2000, and am experiencing a problem. I have a subform that is shown in datasheet view for users to edit data direct to a table. When a user presses the Enter (or Return) key a carriage return is made in the cell, rather than the cursor moving to the next field, which is
4
27829
by: whitej77777 | last post by:
I am trying to write a user defined function that will allow me to strip off the last carriage return and line feed from a text field. We have address fields stored in a text field for our ERP system and some of them have an extra carriage return and line feed at the end of them. This causes havoc when we sync between our ERP system and CRM system. If anyone knows a way to solve this problem the help would be appreciated. Examples:...
2
7041
by: iritchie | last post by:
*(Apologies, I posted this in the SQL Server forum first) Hello all, I am trying to write a query which breaks down a single address field into individual fields, with char(10) or a carriage return as the delimiter. "empltable" is the table I am using, and "address" is the field I am looking to split. So far I have managed to:
1
4184
by: nur123 | last post by:
Thanks in advance who will look at it. I have been encountering an issue which I can’t find a way out of it. What my pgm does: It (java codes) reads oracle table data and creates flat text data files. Another part of the program distributes the extracted text files to unix systems. Problem first occurred: Opening those files in Unix box shows carriage return in the middle of the record as well as at the end of the record.
11
12599
by: evenlater | last post by:
My db allows the user to send email via CDO. The body of the email is determined in code. I have built an email form with To, CC and Subject lines and a large text box for the body of the message so the user can edit the default email message body before sending the message. But when I populate the large text box (txtBody), I can't get it to include the carriage returns. I've tried vbNewLine, vbCrLf, Chr(10) and Chr(13). I've got the...
1
10714
by: jollyroger | last post by:
I have searched the web forums, and can't seem to find an answer to this particular problem I have. In an excel sheet, cells in one column have formatted text in the "wrapped" cells. For many of the cells it is far more than 256 char. After import to Access, the carriage return (CR) and Line Feed (LF) is shown with a square symbol in the text, and the text is just "dumped" into the field without CR or LF. Have also tried to indentify the...
0
8822
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
9528
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...
1
9310
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
9236
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8235
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
6792
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
6072
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4592
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...
1
3298
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.