[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 213
  • Last Modified:

Export a Report from Access to Word with condtional formatting

I have a report with a ton of formatting, I need this report to to export to Word-
and keep all of the conditional formatting-
Can this be done???

I need help!!!


Thanks!
0
smoschkau
Asked:
smoschkau
  • 5
  • 3
  • 2
  • +1
2 Solutions
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
Unlikely.  Access reports exported to Word do not guarantee that all of the formatting will stay intact.  Most developers I know do not go this route.

I think you'll be better off exporting as an Access Snapshot (*.snp) file, which anyone with Office installed can read (I think), or exporting as an Adobe .pdf file (http://www.pdf995.com, among others)

Hope this helps.
-Jim
0
 
Jokra_the_BarbarianCommented:
I think you are going to have to take control of the Word object and do your formatting on export. We used to do this at one company I worked with, but it was with Excel. We placed the data in the cells that we wanted, formatted the font and cell properties for specific cells, etc..
0
 
smoschkauAuthor Commented:
I need it to be in Word- because people need to add comments to the report-
Is there anyway I can get it to export as a picture or something?
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
smoschkauAuthor Commented:
How would I begin writing something like?
for formatting on the export?
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
>Word- because people need to add comments to the report-
fyi be careful going down this road.  I've known of a few cases were less-than-credible users changed data that was generated from an Access report dumped into something editable like Word or Excel, distributed the report to the masses, and when someone spotted an error in the #'s the developer was blamed.  

Just my experience, your mileage may vary.
0
 
smoschkauAuthor Commented:
Thanks for the heads up-
I may create a 'comment' form that will allow the user to to add there comments in then report and then print it out as a snap shot-

Would you think that would work?

How would I word that in code?
0
 
Jim HornMicrosoft SQL Server Developer, Architect, and AuthorCommented:
I do that all the time.  

Create a popup form that prints your report, with a comments textbox that you type your comment in, and in your report create the comments textbox where in your Report.Open event type..

Me.MyCommentsTextbox.Value = Forms!YourPopupFormName!YourPopupFormCommentsTextboxName

There are a couple of other ways to do this, but this one's close enough.
0
 
smoschkauAuthor Commented:
What is the code to export the report to snapshot??

0
 
Eric ShermanAccountant/DeveloperCommented:
Try ...

DoCmd.OutputTo objecttype[, objectname][, outputformat][, outputfile][, autostart]

Example ...

DoCmd.OutputTo acOutputReport, "YourReportName", acFormatSNP, "C:\Temp\MyFileName.snp", False


To echo what Jim was saying, you should always try to control/manage the data within your database.  Once you export it out and allow users to manipulate it your integrity is lost.

ET
0
 
smoschkauAuthor Commented:

Private Sub Command21_Click()
    Dim stCriteria As String
    stCriteria = "[Member Name]=" & Chr(34) & Me.CB_MemberName & Chr(34)
    DoCmd.OutputTo acOutputReport, "ReportTemplate", acFormatSNP, "ExecutiveSummaryReport.SNP", True

End Sub

I have this, as my code but it still isn't reading what is in the combo box??
How can I fix that?

Thanks!
0
 
Eric ShermanAccountant/DeveloperCommented:
Try this ...

Private Sub Command21_Click()
    DoCmd.OutputTo acOutputReport, "ReportTemplate", acFormatSNP, "ExecutiveSummaryReport.SNP", True
End Sub


Add this Filter to the properties of your report ... Make sure to also set Filter On = Yes.  Replace YourFormName with the actual name of your form.

[Member Name] = Forms!YourFormName!CB_MemberName

This will set a filter in the report.

ET

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 5
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now