string manipulation - extract various data

  • Thread starter trevorC via AccessMonster.com
  • Start date
T

trevorC via AccessMonster.com

Hi All,
My latest task is to create a part usage tracking system and incorporate this
into our current system, the first part works ok now and the resultant string
is copied back into a parts used field on my form.
What i need to do is recreate a report using the data that was created and
saved as a string,

Example -
" 09600-02087, Qty=3. 09600-02087, Qty=2. "

I need to get the first part that is the part number and save this into a
variable then get the qty and save this as well. i can get the part number
with Left([text_string], InStr([text_string], ",") - 1).
How can i get the Qty from this (it may be 1,2 or 3 chars in length). I then
need to loop through and find all parts and Qty's. this is so i can rebuild
my report from historical data.

Any help is greatly appriciated
regards
Trevor
 
S

Stuart McCall

trevorC via AccessMonster.com said:
Hi All,
My latest task is to create a part usage tracking system and incorporate
this
into our current system, the first part works ok now and the resultant
string
is copied back into a parts used field on my form.
What i need to do is recreate a report using the data that was created and
saved as a string,

Example -
" 09600-02087, Qty=3. 09600-02087, Qty=2. "

I need to get the first part that is the part number and save this into a
variable then get the qty and save this as well. i can get the part number
with Left([text_string], InStr([text_string], ",") - 1).
How can i get the Qty from this (it may be 1,2 or 3 chars in length). I
then
need to loop through and find all parts and Qty's. this is so i can
rebuild
my report from historical data.

Any help is greatly appriciated
regards
Trevor

Try using the Split function, using a comma as the delimiter argument, or
even a space char. That way you have a dataset you can iterate over (an
array). It's much easier to parse individual elements than it is
'leapfrogging' using Instr.
 

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