tags:

views:

69

answers:

1

Does anyone know if there is a way to print formulas on a MS Access report, much like the way you can change settings in Excel to show only the formulas and no data in a worksheet?

I could possibly go through and wrap all formulas in quotes, but I'm looking to see if there is a setting in the program that will do this for me.

+1  A: 

Sorry, there is none. You are stuck wrapping them in quotes. :( Using VB might save you some time - try something like this.

Function formula()
    On Error GoTo OutOfSections
    Const sRpt As String = "Report1"
    Dim rpt As Access.Report
    Dim ctl As Control
    Dim iCounter As Integer
    DoCmd.OpenReport sRpt, acViewDesign
    Set rpt = Reports(sRpt)
    Do
        For Each ctl In rpt.Section(iCounter).Controls
            If ctl.ControlType = acTextBox Then
                Debug.Print "=""" & Replace(ctl.ControlSource, """", "'") & """"
                ctl.ControlSource = "=""" & Replace(ctl.ControlSource, """", "'") & """"
            End If
        Next
        iCounter = iCounter + 1
    Loop
OutOfSections:

End Function
Praesagus
I added some sample code to help with the uglyness of this. :)
Praesagus
Awesome! I'll try it!
Kyle