Solved

Separate Text from a textbox

Posted on 2009-05-07
4
159 Views
Last Modified: 2012-05-06
I am reading a bardcode into a txtInput.text, which contains a text like this 01605181524 2010
I want to trim the first 5 characters then take from 6 to 11 into txtbatchid.text   then the rest into txtweight
0
Comment
Question by:teogos
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
FER_G earned 150 total points
ID: 24329471
teogos; i don't know if the results ar OK, but you can change the numbers of Start and Length, and you'll get the values that you are expecting.

bardcode = "01605181524 2010"
txtbatchid.text  =  mid(bardcode,6,6) 'you'll get 181524
txtweight.text = mid(bardcode,12)  'you'll get 2010

FerG
Saludos.
--
Ing. Fernando D. Giletta
San Francisco. Córdoba. Argentina.
0
 

Author Comment

by:teogos
ID: 24329598
Seem to work, but there is one more thing that I forget, at the end of txtweight 2010 there is a CR how can I get rid off of this CR to display clean 2010
0
 
LVL 10

Assisted Solution

by:ALaRiva
ALaRiva earned 100 total points
ID: 24329642
txtweight.text = Replace(mid(bardcode,12) ,VbCr,"")
0
 

Author Comment

by:teogos
ID: 24329703
Thanks
0

Featured Post

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month4 days, 10 hours left to enroll

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question