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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse Field

Status
Not open for further replies.

jgus

Technical User
Aug 3, 2001
15
US
I have a Microsoft Access 2000 table called "MBSA" with a field called "machine name". The field's records look like the following:
NSC_SS153958 (10.61.72.86)
DHS2KIMAGE (10.61.76.89)
NSC_CS295642 (10.61.72.108)

As you can see the field actually includes two pieces of information, computer name and ip address. I want to basically leave the computer names in the "machine name" field and pull the ip address into a seperate field called "ip". Of course I want to get rid of the ip address in the "machine name" field and remove the computer name in the "ip" field. The one constant is that there will always be a space between the computer name and ip address and no other spaces will be found in the record. So how do I use that space to seperate out the two pieces of data? I don't care if it is done with VB or a query.

I really appreciate your help. Thanks
 
As Ken said.


or, You can even use the split().

Dim vArray As Variant

vArray = Split([machine name], " ")

[machine name] = vArray(0)
[ip] = vArray(1)


Good luck!
 
That did it thanks for the help. The InStr() function was what I was trying to find. I couldn't remember which one would give me the position of the space. From there I can do the rest.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top