Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Appending data to an exported html filename?

Status
Not open for further replies.

jimbak3r

Technical User
Mar 23, 2005
2
US
Currently I have a simple database of payroll adjustment details imported from an excel file. I've built a report that page breaks to seperate pages for each sales clerk on the report. What I'm trying to accomplish is by using a quick form that I have created that has command buttons setup to Print to file or Email File the report results in HTML format. This way I get each Sales Clerks details in seperate pages.

Currently the process is running and working great. However, the filenames applied to the html files is what I'd like to modify.

Currently I have a report name of "ClawBacks" and a suffix of Page1 so ie.. ClawBacksPage1.html being generated by default. Is it possible to modify in the stDocName = "" option of the script to generate a filename based on the SalesClerk ID that is in the report? Or is there something else I can do to achieve the results I require?

I'm not a programmer so I'm relying on the built in functions that generate the code. Would someone please take a moment and explain if this is even possible and perhaps give me an example of how I can successfully achieve this.

Thank you,

Jim


P.S. If I can get this to work.. i'm hoping I can then automate the process to send files via email.. but send the file to the specific sales clerk involved.. rather than all files to a group or one user.

If I'm getting too involved in custom programming, please let me know.
 
the first bit isn't too hard, just goto the code, and find the Export to HTML line of the code and on that line is an option for the name of the exported file, and add: & "whateverSuffix"

the e-mailing bit, would be involve lots of code.

--------------------
Procrastinate Now!
 
Thanks for the tip,
Here is a part of the code:

Private Sub SavetoFile_Click()
On Error GoTo Err_SavetoFile_Click

Dim stDocName As String

stDocName = "ClawBack"
DoCmd.OutputTo acReport, stDocName

Exit_SavetoFile_Click:
Exit Sub

Err_SavetoFile_Click:
MsgBox Err.Description
Resume Exit_SavetoFile_Click

End Sub

=============================
ClawBack is the report name and in this report I have a field named "MMSCode"

Therefore, and I'm going on Newfie logic here *evil-grin*..

by this example: stDocName = "Whatever" & rs!SalesClerkID & ".html"
it will reference the MMScode Field and place the MMSCode in the filename.

If you require an example of the database or report.. I'll try and put something together without giving too much information about the actual contents of the database.

Thank you for your help thus far.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top