Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Separate Text from a textbox

Posted on 2009-05-07
4
Medium Priority
?
161 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 600 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 400 total points
ID: 24329642
txtweight.text = Replace(mid(bardcode,12) ,VbCr,"")
0
 

Author Comment

by:teogos
ID: 24329703
Thanks
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

715 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