Solved

Separate Text from a textbox

Posted on 2009-05-07
4
158 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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
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…

759 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