Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / December 2007

Tip: Looking for answers? Try searching our database.

a small problem with String functions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andy6 - 30 Dec 2007 14:04 GMT
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.
Linq Adams - 30 Dec 2007 14:49 GMT
Two questions:

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

What version of Access are you running?

Signature

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

Answers/posts based on Access 2000/2003

Linq Adams - 30 Dec 2007 15:08 GMT
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

Signature

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

Answers/posts based on Access 2000/2003

Andy6 - 30 Dec 2007 17:42 GMT
Linq.
Many many thanks. your solution gave me all the components I needed to get
my head around my problem.
regards, Andy.

> If the answer to my last question is Yes, and if you're running Access 2000
> or later, xomething like this will do it:
[quoted text clipped - 7 lines]
>
> Linq
Linq Adams - 30 Dec 2007 18:20 GMT
Glad you got it working!

Happy New Year to you and yours!

Linq.

Signature

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

Answers/posts based on Access 2000/2003

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.