Print conditional formatting

Kayleigh

Member
Local time
Today, 23:04
Joined
Sep 24, 2020
Messages
709
I have code to export my (datasheet) form to RTF format which works nicely. However the conditional formatting is not showing up. Is there anything I can add to this?
Code:
Private Sub cmdExport_Click()

   Dim Fldr As String

   With Application.FileDialog(4)
      .AllowMultiSelect = False
      If .show <> -1 Then Exit Sub
      Fldr = .SelectedItems(1)
   End With
  
DoCmd.OutputTo acOutputForm, Me.Name, acFormatRTF, Fldr & "\" & Me.txtTitle & ".rtf", True, , , acExportQualityPrint

End Sub
 
I could be wrong, but I think you can only export the data, not it's formatting.

If you want to format the exported data, you will probably have to do it one row at a time.
 
Forms are not optimized for printing. Try exporting a report. WHY does the target have to be RTF? Can't you export as a PDF?
 
RTF is easily editable in a Word application. Was considering Excel as well possibly.
 
So, you want to allow them to edit the report you create? Usually we export reports to PDF to avoid that possibility. If the users want to do more analysis, we export to Excel. Excel is much easier to format using VBA than RTF would be.
 
So conditional formatting would be possible when exporting to Excel?
 
You can create an Excel template and export the data into that or you can just use VBA to build the whole thing, including conditional formatting. I don't know how though. When I need to figure out how to do something in VBA, I open Excel, turn on the macro recorder, and look at the code it generates. Then I copy that code into Access. Sometimes I need to modify it to adjust object references.
 

Users who are viewing this thread

Back
Top Bottom