Wrox Programmer Forums
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2007, 05:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default Trim a string in VBA

Hello!
Could anyone provide me with the line of code to trim a string of text?
I have a field that I need to use to value of in my code, but I need to trim the first 3 characters off. For example: The value for field [9-CCNNumber] in a record is "07-43", but I need VBA to only pick up the "43".
Any help is greatly appreciated!

Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
__________________
Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!
 
Old January 18th, 2007, 05:43 PM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 564
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Just do Mid([9-CCNNumber], 4)

That will pick up all characters starting at the 4th one.

Hope that Helps

Mike

Mike
EchoVue.com
 
Old January 19th, 2007, 08:39 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 126
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Mike,
This works perfect! Thank you very much for your help!


Regards,
Laura

The only thing standing between you and your goal is doubt. Quit doubting yourself and you'll be able to accomplish anything!





Similar Threads
Thread Thread Starter Forum Replies Last Post
TRIM, ISTEXT function won't work in Excel VBA code munzer1 Excel VBA 1 May 29th, 2007 09:35 AM
trim a string to the first character jd_erd Access 2 May 6th, 2007 11:01 PM
javascript string Trim() frunction kokuthanda VBScript 0 October 12th, 2006 02:45 AM
String.trim() mrfox BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 1 January 8th, 2006 12:23 AM
Trim() NeoGeo ASP.NET 1.0 and 1.1 Basics 2 January 21st, 2004 11:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.