Parse Delimited Field into Component Fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Every day, I receive about 10K lines of data, delimited by "/", which I paste into a field within a table. Given that I review a lot of related data through a form, I would like to have command button where, upon clicking it, it will parse the delimited field into individual fields on my form. Can anyone provide some sample code?

I know that excel can accomplish the parsing part handily, though I want to accomplish the task with a single program.

Thanks!

Rob
 
-----Original Message-----
Hi,

Every day, I receive about 10K lines of data, delimited
by "/", which I paste into a field within a table. Given
that I review a lot of related data through a form, I
would like to have command button where, upon clicking it,
it will parse the delimited field into individual fields
on my form. Can anyone provide some sample code?
I know that excel can accomplish the parsing part
handily, though I want to accomplish the task with a
single program.
Thanks!

Rob
.
Hi Rob, I haven't got sample code for you. But a
suggestion to lookup online help with the Split function.
This will split a string into an array that you can then
cycle through using a for loop and assign to form fields.
For example (air code)...

dim aData() as variant
dim intLoop as integer

adata=split(myData,"/")

for intloop=0 to ubound(aData())
controls("txt" & intLoop).value=aData(intLoop)
doevents
next intLoop

In the example above the number of possible data segments
is known. Textboxs have the name txt0, txt1,... txtn to
enable a simple loop to assign value.

Luck
Jonathan
 
Back
Top