Problem formatting a filename

  • Thread starter Thread starter Gary Schuldt
  • Start date Start date
G

Gary Schuldt

I have an html field called UNC in my tPhoto table. I display it in a
frmPhoto, which I use to enter and view photo data.

I want it the UNC field to contain information like:

\\Garydesktop\c\My Photos\Camera Images\100_fuji-40415\20040415-002.JPG

That is, a full UNC filename--path plus filename. Once I get a value for
UNC in this format, I can click on it, and it brings up the JPG displayed
with the image program I use, ACDSee. That works fine from my frmPhoto.

However, creating a value for this field is giving me unexpected problems!

1. ACDSee has an IE-type display for folders and filenames. There is an
address bar, and, when I am viewing the photo, I can get the path (without
the filename) displayed in the address field (e.g., \\Garydesktop\c\My
Photos\Camera Images\100_fuji-40415). Does anyone know how to pick up the
fully-qualified filename? (I don't mind cutting and pasting.) That would
solve my problem.

Alternatively:

2. I am also keeping just the filename (e.g., 20040415-002.JPG) in another
text field, since I'm using it as a unique identifier (but not the PK) for
the photo. It makes it easy to search for it in other contexts, like our
website slide shows, etc.

So I thought I'd be smart and just concatenate the path I get from ACDSee
with the filename to get a value for UNC. However, when I do that in Access
VBA using

Me.UNC = Me.UNC & "\" & Me.DateSeqNum

I end up with a mysterious #-sign between the path and the file name, like

\\Garydesktop\c\My Photos\Camera Images\100_fuji-40415#\20040415-002.JPG

That was a surprise!

Anyone have any ideas how I can easily get what I want correctly into one
field?

Thanks in advance.

Gary
 
still not clear enough to understand what you exactly need
but I used to view photo by assigning only the filename
and in the code, i write the follow
if dir("c:\directoryname\" & filename) = "" the
msgbox "No picture file found
els
open your picture fil
end i

edmun
MCP - Access and SQL Serve

----- Gary Schuldt wrote: ----

I have an html field called UNC in my tPhoto table. I display it in
frmPhoto, which I use to enter and view photo data

I want it the UNC field to contain information like

\\Garydesktop\c\My Photos\Camera Images\100_fuji-40415\20040415-002.JP

That is, a full UNC filename--path plus filename. Once I get a value fo
UNC in this format, I can click on it, and it brings up the JPG displaye
with the image program I use, ACDSee. That works fine from my frmPhoto

However, creating a value for this field is giving me unexpected problems

1. ACDSee has an IE-type display for folders and filenames. There is a
address bar, and, when I am viewing the photo, I can get the path (withou
the filename) displayed in the address field (e.g., \\Garydesktop\c\M
Photos\Camera Images\100_fuji-40415). Does anyone know how to pick up th
fully-qualified filename? (I don't mind cutting and pasting.) That woul
solve my problem

Alternatively

2. I am also keeping just the filename (e.g., 20040415-002.JPG) in anothe
text field, since I'm using it as a unique identifier (but not the PK) fo
the photo. It makes it easy to search for it in other contexts, like ou
website slide shows, etc

So I thought I'd be smart and just concatenate the path I get from ACDSe
with the filename to get a value for UNC. However, when I do that in Acces
VBA usin

Me.UNC = Me.UNC & "\" & Me.DateSeqNu

I end up with a mysterious #-sign between the path and the file name, lik

\\Garydesktop\c\My Photos\Camera Images\100_fuji-40415#\20040415-002.JP

That was a surprise

Anyone have any ideas how I can easily get what I want correctly into on
field

Thanks in advance

Gar
 
A simple way to let the user browse for the file to use in the hyperlink
field: place a command button beside your field, with this code in its Event
Procedure:
Me.[NameOfYourHyperlinkFieldHere].SetFocus
RunCommand acCmdInsertHyperlink

If you want to store the path separately from the file name, just use a Text
field instead of a Hyperlink, and use the FileOpen dialog to get the file
name. Details:
http://www.mvps.org/access/api/api0001.htm
You can parse the file from the path by using InstrRev() to search for the
last backslash character (Access 2000 and later), or by using the trick that
Dir() returns just the file name part.

For an explanation of the parts of the hyperlink delimited with #, see:
Introduction to Hyperlink fields
at:
http://allenbrowne.com/casu-09.html
Use HyperlinkPart() to parse out the address bit.
 
Allen,

thanks for the info.

Re: RunCommand acCmdInsertHyperlink

I think I see what you're driving at: When this executes, it's like doing a
Ctrl-K (insert hyperlink), which brings up the Insert Hyperlink dialog box.

So, before I wrote the code, I tested the approach. Within the Insert
Hyperlink box, when I click on "Recent Files" (because I have a .JPG file in
hand). But that .JPG doesn't show up at all in the list.

Here's a common scenario: There's a new batch of digital photos on the
computer as .jpg's. I'm using ACDSee to view them, proceeding from one to
the next using the navigation provided by that program (spacebar = forward,
backspace = backwards). I encounter one I want to enter info about into the
Access DB. I switch to Access, display the frmPhoto, which among other
things contains the UNC field.

Following your suggestion, I put the cursor on the UNC field, clicked on
Insert Hyperlink, but the .JPG I was just looking in ACDSee at is not in the
Recent Files list. I would expect it to be at the top of the list.

I guess I don't understand how an item gets entered in that Recent Files
list in the first place. But, if the one I want were there, it sounds like
your method would work fine!

Any ideas?

Gary

Allen Browne said:
A simple way to let the user browse for the file to use in the hyperlink
field: place a command button beside your field, with this code in its Event
Procedure:
Me.[NameOfYourHyperlinkFieldHere].SetFocus
RunCommand acCmdInsertHyperlink

If you want to store the path separately from the file name, just use a Text
field instead of a Hyperlink, and use the FileOpen dialog to get the file
name. Details:
http://www.mvps.org/access/api/api0001.htm
You can parse the file from the path by using InstrRev() to search for the
last backslash character (Access 2000 and later), or by using the trick that
Dir() returns just the file name part.

For an explanation of the parts of the hyperlink delimited with #, see:
Introduction to Hyperlink fields
at:
http://allenbrowne.com/casu-09.html
Use HyperlinkPart() to parse out the address bit.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Gary Schuldt said:
I have an html field called UNC in my tPhoto table. I display it in a
frmPhoto, which I use to enter and view photo data.

I want it the UNC field to contain information like:

\\Garydesktop\c\My Photos\Camera Images\100_fuji-40415\20040415-002.JPG

That is, a full UNC filename--path plus filename. Once I get a value for
UNC in this format, I can click on it, and it brings up the JPG displayed
with the image program I use, ACDSee. That works fine from my frmPhoto.

However, creating a value for this field is giving me unexpected problems!

1. ACDSee has an IE-type display for folders and filenames. There is an
address bar, and, when I am viewing the photo, I can get the path (without
the filename) displayed in the address field (e.g., \\Garydesktop\c\My
Photos\Camera Images\100_fuji-40415). Does anyone know how to pick up the
fully-qualified filename? (I don't mind cutting and pasting.) That would
solve my problem.

Alternatively:

2. I am also keeping just the filename (e.g., 20040415-002.JPG) in another
text field, since I'm using it as a unique identifier (but not the PK) for
the photo. It makes it easy to search for it in other contexts, like our
website slide shows, etc.

So I thought I'd be smart and just concatenate the path I get from ACDSee
with the filename to get a value for UNC. However, when I do that in Access
VBA using

Me.UNC = Me.UNC & "\" & Me.DateSeqNum

I end up with a mysterious #-sign between the path and the file name, like

\\Garydesktop\c\My Photos\Camera Images\100_fuji-40415#\20040415-002.JPG

That was a surprise!

Anyone have any ideas how I can easily get what I want correctly into one
field?

Thanks in advance.

Gary
 
Back
Top