RE: Fixed Length
- From: dymondjack <dymondjack at hot mail dot com>
- Date: Thu, 5 Feb 2009 13:13:19 -0800
I'm *assuming* that you don't want to change the actual data in your table to
match these formats, but rather pull the existing, normal, formats from the
record, and run a function to build that information into a string that you
can utilize with whatever barcode label you are working with.
I'm also assuming that this barcode label will be on a report so that it can
be printed? If so, you would ideally run the function from the report, as a
calculated field on the report.
If you could verify this, and give the datatypes for your fields, I should
be able to come up with a function to handle it.
*If* by chance you were going to update the actual table values to match
this desired format, I would strongly advise against it. All fields would
have to be Text fields in order for this to work accurately (no matter what
method you use), and for a number of other reasons, its generally a bad idea.
The barcode output string can be easily handled by two functions, and
reading values back from the string can be parsed easily as well, especially
due to the fixed lengths, and will require no adverse interference with the
core data in your tables.
So, let me know what the datatypes are and we'll go from there.
--
Jack Leach
www.tristatemachine.com
- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
"Ann" wrote:
Thank you for the help. I'm not sure what event this should go on though. I.
tried a few of them and those that didn't give me errors didn't do anything
but update the table with the number I entered. There weren't and leading
zeros.
The only thing I did was to put the JobId after strOrig =
"dymondjack" wrote:
I believe there's a built-in function that can to this for you, but I'm not
sure what it is, so I'll offer an alternative way: run a loop until the
length of the string is equal to your fixed length, adding a 0 to the
beginning of it each time it loops. Note that all fields will need to be
string fields to do it, and each field would need a separate loop.
Dim strOrig As String
strOrig = 'Your original jobID, RunNumber, etc
While Len(strOrig) < 8
strOrig = "0" & strOrig
Wend
You would have to build them together from there...
--
Jack Leach
www.tristatemachine.com
- "First, get your information. Then, you can distort it at your leisure."
- Mark Twain
"Ann" wrote:
I have seven fields in my Table that need to be concatenated to create one
field used to create a 2D Barcode. Each of the seven fields has a fixed
length and the total lenght of all the fields has to be 100 characters.
These are the fields:
JobId (8 char)
Date (8 char)
RunNumber (2 char)
RecordNumber (8 char) - the key, starting with 1 and incrementing by 1 for
each record.
PageNumber (5 char)
PageCount (5 char)
Remaining (64 char)
I've done the Date field...that was the easy one...but how do I do the other
fields? The data will be entered and each field could use 1 character or all
the characters at the time it's entered. I need to have the remaining
character spaces fill in with zeros to the left of the data entered? Thanks
for the help in advance.
- References:
- Fixed Length
- From: Ann
- RE: Fixed Length
- From: dymondjack
- RE: Fixed Length
- From: Ann
- Fixed Length
- Prev by Date: Re: Calculating the number of records in a listbox/combo box
- Next by Date: Re: rename a form in an external database
- Previous by thread: RE: Fixed Length
- Next by thread: Re: Fixed Length
- Index(es):
Relevant Pages
|