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!

Reading Variable Length Text strings

Status
Not open for further replies.

GessTechie

Technical User
Jan 24, 2003
10
US
Good Morning!

I have a text file that I want to separate into individual fields in Access. However, the text sizes vary in length and they do not hold their position within the text string (I imported the text into 1 field). The import text wizard actually screwed me more than helped.

I have used left, right and mid statements to read as much as possible, but I need to check the read to determine if it is Null or if it is a certain length. If it is a certain length, I then want to read the next text in the field.

Any coding help will be appreciated.

Thanks
 

Try something like
Code:
dim mystring as string
dim myval as long
dim sizer as long

sizer=47

myval = Len(mystring)
if my val>sizer then call SomeMoreCode
From the Access help file:

Len Function

Returns a Long containing the number of characters in a string or the number of bytes required to store a variable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top