Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
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 April 15th, 2008, 08:32 AM
Authorized User
 
Join Date: Feb 2008
Location: , , .
Posts: 34
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hewstone999
Default Changing a string?

I have the following code:

a = "03-Patients-Data"

How can i change the "03-Patients-Data" - to - "03_Patients_Data"

 
Old April 15th, 2008, 10:57 AM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Dim TextArray As Variant
Dim aText As String

aText = "03-Patients-Data"

TextArray = Split(aText, "-")

aText = TextArray(0) & "_" & TextArray(1) & "_" & TextArray(2)

Did that help?




mmcdonal

Look it up at: http://wrox.books24x7.com




Similar Threads
Thread Thread Starter Forum Replies Last Post
changing connection string at runtime kscase VB Databases Basics 2 July 3rd, 2007 10:47 AM
changing numeric string to number not possible? Brian Campbell XSLT 1 November 16th, 2006 06:36 PM
Changing length of string automatically ryanvdm2 Classic ASP Basics 5 September 4th, 2005 06:20 PM
how to replace a string with another string/number crmpicco Javascript How-To 4 March 14th, 2005 12:59 PM





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