UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Crystal - Help Formatting A Field, 14.0.4.738    
 
   
Johnny-Don
post May 11 2015, 01:13 PM
Post#1



Posts: 3
Joined: 11-May 15



Hello All! Great info on this site.

I have a very specific request for some help in Crystal. I'm no expert, not even close, I took a 2 day class about a month ago.

What I have is an MS database that has a mutliple line (paragraph) field. It's the description of a part number. Some have several lines, some have 1. What I need, in order to format it correctly to import it our new ERP program is for each line of the paragraph to be numbered, starting with a new sequence for each part number. For instance.

PART1234-A this is the description for
this part number, it could

contain a space in it as above
this is the end of the description


PART546-344 This is a single line description for this part


The Above example would have to look like this:


PART1234-A 000001this is the description for
PART1234-A 000002this part number, it could
PART1234-A 000003
PART1234-A 000004contain a space in it as above
PART1234-A 000005this is the end of the description


PART546-344 000001This is a single line description for this part

Is this possible? Thanks in advance
Go to the top of the page
 
Johnny-Don
post May 11 2015, 02:43 PM
Post#2



Posts: 3
Joined: 11-May 15



I apologize, I didn't see any option to edit my post. My formatting didn't come across as it was in my text editing window. The Part number is in it's own field, the description of the part is in another field. I'm going to give the an example of my raw data again:

PART1234-A this part number, it could

__________ contain a space in it as above
__________ this is the end of the description


PART546-344 This is a single line description for this part

**please ignore the white font, that's the only way I could get it to format correctly
Go to the top of the page
 
GroverParkGeorge
post May 11 2015, 04:07 PM
Post#3


UA Admin
Posts: 31,250
Joined: 20-June 02
From: Newcastle, WA


You can, I believe, use the Split() function to put the different lines into a array, from which you can then extract is part as an Indexed element of the array.

However, without trying this I'm not sure you can use the line breaks, so this is untested.

Dim I as Integer
Dim strPartNumber() As String
strPartNumber() = Split (strFieldContaingPartNumbers, vbcrlf)
For I = 0 to UBound(strPartNumber())
Debug.Print I+1 & " " & strPartNumber(I)
Next i
Go to the top of the page
 
Johnny-Don
post May 12 2015, 06:49 AM
Post#4



Posts: 3
Joined: 11-May 15



Thanks for the reply, forgive my ignorance, but can you tell me; does this need to be a Formula Field, or a formula inside format editor my Description in details?
Go to the top of the page
 
GroverParkGeorge
post May 12 2015, 10:40 AM
Post#5


UA Admin
Posts: 31,250
Joined: 20-June 02
From: Newcastle, WA


Create it as a VBA Function.

Use that function to update the contents of the field with the line numbers.

I suspect you might need more specific instruction, so let use us know if that's the case.
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    18th December 2017 - 09:40 AM