Full Version: Vary Report Appearance
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
bigriff
Greetings...

First time I was asked this so I thought it better to ask if any one already knows the best way to accomplish it:

I need the reports from a given record set to vary in appearance so as to appear as letters prepared by different people.

Record 1 - fonts, line-height etc. are to vary from Record 2- and so on...

Slight differences in layout would be nice, such as paragraph width, margins, alignment of signature (image) etc. if its not out of the realm of possibility.

Has any one already done something like this?

Thanks
MadPiet
Sounds like you would want to do some Word automation to do that. You can't alter report formatting for individual records except for conditional formatting. It's just not designed to do that. If you need super flexibility, automate Word. MUCH easier in the end. (If you need to, create a few macros to get the hang of it.)
pere_de_chipstick
Hi bigriff

I'd approach this by passing a value via the reports OpenArgs property and then, in the On Open Event of the report use a Select Case to identify the argument passed and amend the properties of the controls to display the different formats you want.

e.g.
DoCmd.OpenReport strSelRpt, acViewPrevew, , stLinkcriteria, , strArgs
Where strArgs is 1,2 3, etc

Then in the On Open Event of the report (e.g.)
CODE
    Select Case CInt(Me.OpenArgs)
    Case 1
        Me.SomeControl1.ForeColor = vbBlack
        Me.SomeControl1.Fontsize = 10
        Me.SomeControl1.FontName = "Arial"
        Me.SomeControl1.Italic = True

        Me.SomeControl2.ForeColor = vbBlack
        Me.SomeControl2.Fontsize = 10
        Me.SomeControl2.FontName = "Arial'
        Me.SomeControl2.Italic = True

    Case 2
        Me.SomeControl1.ForeColor = vbBlue
        Me.SomeControl1.Fontsize = 12
        Me.SomeControl1.FontName = "calibri"
        Me.SomeControl1.Italic = False

        Me.SomeControl2.ForeColor = vbBlue
        Me.SomeControl2.Fontsize = 12
        Me.SomeControl2.FontName = "calibri"
        Me.SomeControl2.Italic = False

    Case 3

'etc.
    End Select


If you needed different formats for each record printed out on a single report run, then you would need to include the formatting value in the reports recordset and then include the above code in the On Format / On print events of the section to be formatted, in this case instead of Select Case Me.OpenArgs, you would refer to the field name defining the format (e.g Select Case Me![FormatID])

hth
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.