View Full Version : Replace / with ~ if date found in string


chris-uk-lad
11-04-2008, 01:15 AM
Hi all,

Tried finding a solution in this site but couldnt find one for searching a string for a specified character (if you see one, link me :x)

Im searching through a column to create folders based on a field value. At a point i come across a field value that contains a date, so i wish to find the values that contain a date, and when found, replace the / with ~ to allow me to create.

e.g
James 01/01/01
James 01~01~01

Atm im using the code

Do Until Name.EOF
count = 1
MkDir strTempFilePath & "\" & Name![aName]
jumpin1:
Name.MoveNext
Loop

Rabbie
11-04-2008, 01:57 AM
getting closer but i hit a problem :(


If InStr(Name![aName], "/") Then
Name![aName] = Replace(Name![aName], "/", "~")
End If
MkDir strTempFilePath & "\" & Name![aName]
What problem did you hit? The more relevant info you can give the easier it is for you to get help.

chris-uk-lad
11-04-2008, 01:57 AM
getting closer but i hit a problem :(

If InStr(Name![aName], "/") Then
Name![aName] = Replace(Name![aName], "/", "~")
End If
MkDir strTempFilePath & "\" & Name![aName]

chris-uk-lad
11-04-2008, 02:05 AM
sorry, i ninja edited the above as i had put solved prematurely.

The error is database object is read only, which i dont get as the database is not read only :x i figure its going to change the value in the foeld first before creating the folder so guess at a database issue?

also might a sort of count be needed to work through the characters?