SPLIT problem (1 Viewer)

chris-uk-lad

Registered User.
Local time
Yesterday, 20:51
Joined
Jul 8, 2008
Messages
271
Hi, starting to pull my hair out over this one now, i really have no idea whats wrong with it. Im trying to use a split function (even a stand alone one which should 100% work) yet still come up with an error.

One ive taken from this board to test im not doing wrong and is standalone:

Code:
Dim varSplit As Variant
varSplit = Split("C:\Pictures\1.jpg", "\")

Yet i get "Compile Error: Sub or Function not defined"

why????? It highlights SPLIT after the error pops but everything required (as far as im aware) is contained in those 2 lines to make it work.
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 04:51
Joined
Sep 12, 2006
Messages
15,653
which access version are you using

split doesnt appear to be in A97, but is in later versions
 

chris-uk-lad

Registered User.
Local time
Yesterday, 20:51
Joined
Jul 8, 2008
Messages
271
97 ^^;

would explain something as i have it working on 2000.

Is there a work around?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 04:51
Joined
Sep 12, 2006
Messages
15,653
you could emulate it by using the instr function. to split a string into sections.

i should imagine thats what split does anyway.
 

chergh

blah
Local time
Today, 04:51
Joined
Jun 15, 2004
Messages
1,414
Put 'access 97 split function' into google and you will find functions that people have written that provide the same functionality.
 

chris-uk-lad

Registered User.
Local time
Yesterday, 20:51
Joined
Jul 8, 2008
Messages
271
inStr might have saved me an extra line of code than if i wanted to do with SPLIT as i needed the position of a character created for mthe split. Thanks for both your help though :)
 

Users who are viewing this thread

Top Bottom