attach .doc or .jpg to record in form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear people,

I have a form with personal records. I would like to make a button wich
users can use to hyperlink a document or picture to this record. When they
push the button a standard DIR (defined by me) must be opened, wherefrom a
document can be selected an is attached to the record (that is only the
location of the doc as a hyperlink.

Thanx for your input!

Paul
 
Paul said:
Dear people,

I have a form with personal records. I would like to make a button wich
users can use to hyperlink a document or picture to this record. When they
push the button a standard DIR (defined by me) must be opened, wherefrom a
document can be selected an is attached to the record (that is only the
location of the doc as a hyperlink.

Thanx for your input!

Paul

Any reason you can't use the OpenSaveFile API from AccessWeb to get the
file path and save it to your table? then just format the text field
as a hyperlink on your form.
http://www.mvps.org/access/api/api0001.htm

if you want to set an initial directory... hmm... maybe you can use the
BrowseFolder API... I'm not sure. If there's no answer for you at
AccessWeb, check out VBNet
http://vbnet.mvps.org/

Randy has more VB6 code there than you can shake a stick at. I'm sure
it's there somewhere!!!

I guess you could use the BrowseFolder API to set the initial
directory... or I could just stop being so lazy and play with it... but
there's a section where you set the initial directory in the code...

MsgBox "You selected: " & ahtCommonFileOpenSave(InitialDir:="C:\", _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")

So there's nothing stopping you from doing something like:

dim strInitialDir as string
strInitialDir = BrowseFolder("Select an initial Directory...")

MsgBox "You selected: " & strInitialDir & " for your starting
directory...

but you'd just pass that variable like this (note the slight
modification...):

ahtCommonFileOpenSave(InitialDir:=strInitialDir, _
Filter:=strFilter, FilterIndex:=3, Flags:=lngFlags, _
DialogTitle:="Hello! Open Me!")
 
Back
Top