By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,671 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,671 IT Pros & Developers. It's quick & easy.

Masking a portion of stored link to image

imrosie
100+
P: 222
Hi,

I need some help please. I have an image database (which so far works great) However, when I pull in a file in the form to store (actually the link), the image is shown in a subform and the name of the image is displayed in a control (on main form called 'image description). Currently 'image description' looks like this:

D:\imageDogs\ChestertheDog.jpg

Unfortunately, I need to mask out the first portion of the link, so that only the NAME portion shows (i.e. 'ChestertheDog). IIf possible 'd like to also store the .jpg in another (field/control) on the form as well. Is there a way to mask out the first portion and cutting off the .jpg? I'm a newbie so any help would be appreciated. thanks

Rosie
Jun 5 '07 #1
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 218
Hi Rosie

You can try:-
  1. Use StrReverse with your image path;
  2. Look for the backslash (InStr) and store its position;
  3. Use Left(ImagePath, (SlashPosition - 1)) to slice off the image name;
  4. Use StrReverse to reverse the image name back to left-to-right.
Alternatively, you could investigate the use of InStrRev to achieve the same result.

HTH
Steve
Jun 6 '07 #2

imrosie
100+
P: 222
Hi Rosie

You can try:-
  1. Use StrReverse with your image path;
  2. Look for the backslash (InStr) and store its position;
  3. Use Left(ImagePath, (SlashPosition - 1)) to slice off the image name;
  4. Use StrReverse to reverse the image name back to left-to-right.
Alternatively, you could investigate the use of InStrRev to achieve the same result.

HTH
Steve
Thanks so much for pointing me in a direction. I'm going now to research how to do either.
If anyone has an example to show me, it would be greatly appreciated. thanks, I'll update you with the code when I get it working.

Rosie
Jun 6 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.