p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Beginning VB 6 (http://p2p.wrox.com/forumdisplay.php?f=75)
-   -   String Manipulation with VB 6 (http://p2p.wrox.com/showthread.php?t=8237)

Jay5817 January 16th, 2004 12:23 PM

String Manipulation with VB 6
 
Hi,

I have an access database that contains alphabets and numbers eg:

HP Monitors: Item code: 1000000001. Location: Main
Epson Printers: Item code: 1000000002: Location: Springfield
Dell Dimension 2400: Item code: 1000000003. Location: Satellite
Brother HL - 5040 Printer: Item code: 1000000004: Location: Colesville

I'm looking for a way to extract just the item codes and transfer them to a bound text box in an Access form with VB code. I'm unable to use the Left, Right or Mid functions because the item codes appear
in random positions. Any suggestions will be greatly appreciated.

Thanks,
Jay


jrwlkn January 16th, 2004 12:35 PM

Do all of the codes have the term 'Item Code: ' in front of them??


Jay5817 January 16th, 2004 12:41 PM

Yes, they all have item code: in front of them.


jrwlkn January 16th, 2004 02:08 PM

Since they all have 'code' in front of them you can use an InStr() function to determine the position of the word 'code'...then use that position to mark the coordinates for the mid() string function. I am assuming that all the item codes have the same number of characters.
Let me know how you make out or if you need some coding help.

John



All times are GMT -4. The time now is 05:21 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.