Extracting text from a declared string

T

tonybury

Ok...I've been searching and searching but I haven't been able to figure a
good way to do this. I sure it will be easy but my brain has had enough.

This is not designed by me so I am having to work around a poor design
structure....

I have a resultset that has 213 char. within it. This I am declaring to a
string called temp.

What this resultset contains is the full business name, contact, address,
city, state, zip and country information. I know the exact field sizes they
used to write the data but now I need to extract the data into seperate
fields within my form. Anyone have some good ideas on how to address this
situation.

I have been going in the direction of something like below:

temp = Left(rs!Billto,41) - this will give me the Company Name

now the next set of information starts at char 42 and is 41 char long.

temp = Left(instr(42,rs!billto),len(temp,41)) - or as such.....and yes I
already know that this won't work..that is why I am finally giving up and
asking.

I want to extract that and keep going throught the text till the end.


Thank you!
 
M

Marshall Barton

tonybury said:
Ok...I've been searching and searching but I haven't been able to figure a
good way to do this. I sure it will be easy but my brain has had enough.

This is not designed by me so I am having to work around a poor design
structure....

I have a resultset that has 213 char. within it. This I am declaring to a
string called temp.

What this resultset contains is the full business name, contact, address,
city, state, zip and country information. I know the exact field sizes they
used to write the data but now I need to extract the data into seperate
fields within my form. Anyone have some good ideas on how to address this
situation.

I have been going in the direction of something like below:

temp = Left(rs!Billto,41) - this will give me the Company Name

now the next set of information starts at char 42 and is 41 char long.


Use the Mid function:

temp2 = Mid(rs!Billto, 42, 41))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top