Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Extracting Text String
Hamish 
    
13 years ago
Hi Richard,

Just continuing where I left off and what I was able to figure out, but still need further guidance on how to extract text data.

I have tried using the (instr function)...as you have suggested but still finding it difficult to line-up the text into one row.

Function in Query:

LastStr: InStr(50,[Field1],"1") which locates the last (1) in the row
CarrierName: Mid([Field1],[LastStr]+1,100) which pulls out the carrier names.

The above (instr function)...where I was able to pull out the desired data gives me the below result.

Field1 LastStr CarrierName
05:00    74033          3169457      1     1     1 50
BORDER EXPRESS     KIMBERLY CLARK AUSTRALIA 0 BORDER EXPRESS     KIMBERLY CLARK AUSTRALIA
06:00    74034          3169457      1     1     1 50
SCT LOGISTICS     COLGATE PALMOLIVE 0 SCT LOGISTICS     COLGATE PALMOLIVE


Now I can't seem to figure out how to line this up into one row of text as an example below is what I'm looking to achieve.


Field1 LastStr CarrierName
05:00    74033          3169457      1     1     1 50 BORDER EXPRESS     KIMBERLY CLARK AUSTRALIA
BORDER EXPRESS     KIMBERLY CLARK AUSTRALIA 0
06:00    74034          3169457      1     1     1 50 SCT LOGISTICS     COLGATE PALMOLIVE
SCT LOGISTICS     COLGATE PALMOLIVE 0


Your expert advice is highly appreciated.

Regards

Hamish


Reply from Richard Rost:

It looks like you just need to remove a NewLine character from in there and it's exactly the way you want it. Try:

MyString = Replace(MyString,vbNewLine,"")

This will replace the NewLine character with a blank string.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/17/2026 4:43:37 AM. PLT: 0s