Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Enable Code to work anywhere

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chase - 05 Jan 2006 15:42 GMT
In the code below I had to stipulate the full UNC for "DoCmd.CopyObject" How
do I set this up to work anywhere.

Code
Dim StrBDM As String
Dim StrPath As String

   StrBDM = ("qctb" & Forms![frmReportOps]![cboBDM])
   StrPath = "\\admiral-srv1\data\VolumeDatabase\Reports\" & txtFileName &
".xls"
   DoCmd.SetWarnings False
   Me.Form.Requery
   DoCmd.CopyObject "\\admiral-srv1\data\VolumeDatabase\ProcessReport.mdb",
StrBDM, acQuery, "qctbReport"
   DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, StrBDM,
StrPath, True
   DoCmd.DeleteObject acQuery, StrBDM
   DoCmd.SetWarnings True
chris.nebinger@gmail.com - 05 Jan 2006 16:10 GMT
Work anywhere?  What do you mean?  Have the user input the palce to put
the file?  Try here:

http://www.mvps.org/access/api/api0001.htm
Chase - 05 Jan 2006 16:40 GMT
Work anywhere means local drive C:\ mapped server address P:\ or the full
server UNC \\XXX the mapped server address may very from PC to PC.

> Work anywhere?  What do you mean?  Have the user input the palce to put
> the file?  Try here:
>
> http://www.mvps.org/access/api/api0001.htm
Klatuu - 05 Jan 2006 17:10 GMT
The site suggested to you is the best solution for this problem.  It presents
a dialog box that will allow you to navigate to the file and select it.  It
will return the full path and name of the file which you can use in your code.

> Work anywhere means local drive C:\ mapped server address P:\ or the full
> server UNC \\XXX the mapped server address may very from PC to PC.
[quoted text clipped - 3 lines]
> >
> > http://www.mvps.org/access/api/api0001.htm
chris.nebinger@gmail.com - 06 Jan 2006 14:24 GMT
Okay, I think I understand.  You want to be able to convert drive
letters to the UNC names.  Your example used UNC, so I didn't
understand your intentions.

http://www.mvps.org/access/api/

There is an example for converting mapped drives to UNC.  However, the
local drive will not convert, because it is potentially placed in a
folder that isn't shared.

Let me know if you have any more problems.

Chris Nebinger
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.