data string

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

Guest

Hi:

How do i load this data string from one field into 7 fields where the "-" is
the separator?
01-00-000-000-1698-00-0000

Thanks.
Lourdes
 
If that's stored in a variable strInput, you can use the following:

Dim intLoop As Integer
Dim varValues As Variant

varValues = Split(strInput, "-")

If IsNull(varValues) = True Then
' There was nothing in strInput
Else
For intLoop = LBound(varValues) To UBound(varValues)
Debug.Print varValues(intLoop)
Next intLoop
End If

For the input you gave, varValues(0) would be 01, varValues(1) would be 00,
varValues(2) would be 000 and so on until varValues(6), which would be 0000
 
Thanks for the quick reply. I'm not too familiar with MACROS & MODULES so
how should I approach the listed code?

Lourdes
 
How do I get this store data into specific fields in a table? For example,
how do I tell it to take the first two digits and store data to the field
named 113 CO in a table?

Thanks.
Lourdes
 
Back
Top