PC Review


Reply
Thread Tools Rate Thread

a small problem with String functions

 
 
Andy6
Guest
Posts: n/a
 
      30th Dec 2007
I am dealing with strings that contain text such as 'Box1,1' to 'Box30,14'
and I need to seperate out the numbers either side of the comma (,).
Can anyone help with string functions or code to do this and store the
numbers in integer variables.
Many thanks in advance. Andy.
 
Reply With Quote
 
 
 
 
Linq Adams via AccessMonster.com
Guest
Posts: n/a
 
      30th Dec 2007
Two questions:

Do all the strings have Box, the comma and two "numbers?"

What version of Access are you running?

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200712/1

 
Reply With Quote
 
 
 
 
Linq Adams via AccessMonster.com
Guest
Posts: n/a
 
      30th Dec 2007
If the answer to my last question is Yes, and if you're running Access 2000
or later, xomething like this will do it:

Dim OriginalString, StrippedString As String

StrippedString = Replace(OriginalString, "box", "")
Me.FirstNumber = Left(StrippedString, InStr(StrippedString, ",") - 1)
Me.SecondNumber = Right(StrippedString, Len(StrippedString) - (InStr
(StrippedString, ",")))

Linq

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

 
Reply With Quote
 
Andy6
Guest
Posts: n/a
 
      30th Dec 2007
Linq.
Many many thanks. your solution gave me all the components I needed to get
my head around my problem.
regards, Andy.

"Linq Adams via AccessMonster.com" wrote:

> If the answer to my last question is Yes, and if you're running Access 2000
> or later, xomething like this will do it:
>
> Dim OriginalString, StrippedString As String
>
> StrippedString = Replace(OriginalString, "box", "")
> Me.FirstNumber = Left(StrippedString, InStr(StrippedString, ",") - 1)
> Me.SecondNumber = Right(StrippedString, Len(StrippedString) - (InStr
> (StrippedString, ",")))
>
> Linq
>
> --
> There's ALWAYS more than one way to skin a cat!
>
> Answers/posts based on Access 2000/2003
>
> Message posted via http://www.accessmonster.com
>
>

 
Reply With Quote
 
Linq Adams via AccessMonster.com
Guest
Posts: n/a
 
      30th Dec 2007
Glad you got it working!

Happy New Year to you and yours!

Linq.

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000/2003

Message posted via http://www.accessmonster.com

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Q: String (Capital S) vs string (small s)? Martin Arvidsson Microsoft C# .NET 11 20th Nov 2006 03:51 AM
how to make two references to one string that stay refered to the same string reguardless of the changing value in the string? Daniel Microsoft Dot NET 7 12th Nov 2004 10:08 AM
Colour functions of Chip - small problem Raina Microsoft Excel Programming 1 27th Oct 2004 12:37 PM
Colour functions of Chip - small problem Raina Microsoft Excel Programming 1 27th Oct 2004 09:43 AM
Re: Converting a string to a string that contains the ASCII values of each letter in the origional string Frank Oquendo Microsoft C# .NET 0 31st Jul 2003 08:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:33 PM.