Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using the split function

Status
Not open for further replies.

lexis7

Programmer
Sep 23, 2002
26
US
hi,

I have tried to read up on this split function, but every code is different and i don't know how to interpret it all. can anyone help me with this. I am using access 2000, and i want to split the following:

Field name: Orginal Code
example of code entry: 14:863618:4387:0:0:99
I want to split it into 6 separate fields after the orginal field.

Thanks for any help!

alexis
 
I would suggest looking up the left and the Right functions... they will probably be easier for you to use...

--James
junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
James,
thanks for your suggestion but the code i'm trying to split has different lengths, for examples see below.

what i have already done with no success is create a form with a command button(cmdSplit) and have it split the "code" field in the "code" table. Any suggestions on what i'm doing wrong will be great! thanks!

sample codes:
14:863618:4387:0:0:99
10:a0:4739:91:9167:237
1:a0:4739:91:9158:237

The code i'm using:
Private Sub cmdSplit_click()
Dim mystring As String
Dim myArray() As String
mystring = Code!Code
myArray = Split(mystring, [:])
End Sub
 
get me your email address and i'll send you a file i just made for you...

--James junior1544@jmjpc.net
Life is change. To deny change is to deny life.
 
Code:
Private Sub cmdSplit_click()
    Dim mystring As String
    Dim myArray As Variant[tab][tab]'CHANGE
    mystring = Code!Code
    myArray = Split(mystring, ":")[tab][tab]'CHANGE

End Sub

I "ASSUME" this is a dummy snippet abstracted from your actual procedure, as there is no instantiation of the recordset "Code" in evidence.

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top