Link to home
Start Free TrialLog in
Avatar of philkryder
philkryder

asked on

how can I dynamically specify the output location of an MS ACCESS report

I have a system of about 30 programs - ACCDBs.
They all output reports as PDFs to a fixed location:
C:\myapp\output

How can relocate the myapp folder and have the reports output to the new location such as
h:\myhomedirectory\myapp\output

thanks
Phil
Avatar of Kelvin Sparks
Kelvin Sparks
Flag of New Zealand image

The output location would have been saved when you created the reports. If the output is generated in VBA, you need to edit it there in each case, if in a macro (possibly in the form you create the report from, edit it there.


Kelvin
ASKER CERTIFIED SOLUTION
Avatar of mbizup
mbizup
Flag of Kazakhstan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
no points please.  Minor correction to mbizup's code:

strOutputPath = DLookup("Data", "tblPaths", "[FieldName] = 'PDFReportPath'")
Dale,

My code was correct... but the explanation may not have been clear.  I used that format because of a lack of horizontal space.  It might be clearer in a code snippet.

tblPaths contains a single record.  The FieldNames in my previous post are the actual columns in that table.  So pictured another way, the DATA in tblPaths is:

PDFReportPath                             webPath                       WorkOrderInputFiles           ImagesPath  
_______________________________________________________________________________________________________________________     

h:\myhomedirectory\myapp\output         www.mysite.com           h:\myhomedirectory\myapp\workorders        h:\myhomedirectory\myapp\Images       

Open in new window

Miriam,

I get it, your Paths table contains a single record and multiple fields, very "non-normal" of you.  I should have figured that out when I saw the "FieldName" header on your list.

;-)