Upload attachment to network drive

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

Guest

I'm thinking this shouldn't be difficult, but I'm not finding any leads.

I need to allow users of a replicated database to upload attachments (docs,
jpgs, tifs, etc.) to a network drive. I'd like the form to create a new
directory to sore the attachment or use an existing one if previously created
based on the Record ID.

I have no idea how to allow the user to browse their computer and then
upload or attach the document. I also want to store the link to this file so
that it can be browsed by other users or included in reports.

Since it's replicated and attachments can be so big I figured this would be
the way to go rather than an OLE scenario.
 
Hi,


Someone can use the FileSearch object (from Office) . You need a
reference to Microsoft Office Object Library in the application. Among other
sources of information that discuss it: Access Developers Handbook.


Hoping it may help,
Vanderghast, Access MVP
 
I found this function from another MVP that opens the the standard Windows
OpenFile dialog, but I don't how to get the string into an access form
textbox.

http://www.pacificdb.com.au/MVP/Code/GetFileName.htm


How do I get the string (I believe it's called) " getfilename" into a text
box on a form? From there I think I can just the filecopy function to copy
the selected file to the network drive.
 
Hi,


OpenFile dialog is generally based on an API that return the string of
the file to be open; it does not open the file itself (the name of the
function is misleading). The easiest way to open a file is probably to put
it as a hyperlink, or to use the function API function ShellExecute. You can
get details from AllAPI at http://www.mentalis.org/.


Hoping it may help,
Vanderghast, Access MVP
 
Actually in this instance all I want to do right now is capture that string.
The open part is something I'll work on later.

Right now I'm working on having the end-user browse his or her computer to
find the file which the getfilename will put into a textbox and then there
will be an an upload or attach command button which will run the copyfile
function based on this string and a hard-coded directory.

The part I don't understand is how do I get a VB module variable
"getfilename" into an Access textbox.
 
Hi,


That's a function, even if it is a VBA function. A possible way is to
push it. Have a line of code, in the form, that does


Me.ControlName=GetFileName( ... )



in the same way you would use Now( ), to get the actual date and time, or
the result of any VBA-function, pre-defined by the system, or defined by you
and publicly accessible.




Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top