Trimming charecters

puthenveetil

Registered User.
Local time
Today, 21:53
Joined
Aug 9, 2004
Messages
94
Hi all,

In my form I use browse option to select a file from directory.In the field it will like this c:\database\xxxx.jpg . This c:\database\ will be constant all time . I want only xxxx.jpg in the field. How can I cut off this c:\database while updating the record.


Thanks in advance

thankachan
 
If using A2000 or above then use the InStrRev() function to get the position of the last \ and then use the Right() to obtain only the file name without the path.

i.e.

Code:
Right([i]myData[/i], InStrRev([i]myData[/i], "\"))
 
thanks SJ,

Pardon my ignorance, where could I use this code, afterupdate or ???
 
I don't know what controls you have in order to give the best answer although the form's BeforeUpdate event would, most likely, be best.
 
SJ,

I can't make that work..I am attaching a sample db with this..If possible please add the code to that..

Thanks in advance


Thankachan
 

Attachments

Users who are viewing this thread

Back
Top Bottom