Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 16th, 2004, 12:23 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

Reply With Quote
  #2 (permalink)  
Old January 16th, 2004, 12:35 PM
Authorized User
 
Join Date: Dec 2003
Location: Middletown, CT, USA.
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #3 (permalink)  
Old January 16th, 2004, 12:41 PM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
  #4 (permalink)  
Old January 16th, 2004, 02:08 PM
Authorized User
 
Join Date: Dec 2003
Location: Middletown, CT, USA.
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String manipulation john316 SQL Language 1 October 1st, 2007 04:24 PM
String manipulation pcase XSLT 5 June 14th, 2007 10:32 AM
String Manipulation twsinc Access 3 February 23rd, 2004 09:57 AM
String Manipulation Ben Access VBA 2 July 8th, 2003 05:53 AM



All times are GMT -4. The time now is 10:55 AM.


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