Switching between formats in a report

  • Thread starter Thread starter Lynne
  • Start date Start date
L

Lynne

I have to produce vendor letters that have two different
layouts - one for vendors with a single detail line and a
different layout for vendors with multiple detail lines.
I'd like to keep my output in vendor number order. Is
there a way to switch back and forth between the 2
layouts depending on line count or do I have to do two
seperate reports and hand sort the output?

TIA,
Lynne
 
The single detail looks like a letter... Re: ______ "To
whom it may concern...Enclosed is our check in the amount
of ____ for the month of _____. Sincerely etc."

The one for multiple details has "Enclosed is our check
in amount of _(total)_ for month of _____." Then it
should have the name, address, case # and amount for each
detail line in columns.

Thanks
 
The single detail looks like a letter... Re: ______ "To
whom it may concern...Enclosed is our check in the amount
of ____ for the month of _____. Sincerely etc."

The one for multiple details has "Enclosed is our check
in amount of _(total)_ for month of _____." Then it
should have the name, address, case # and amount for each
detail line in columns.

Thanks
Lynne,
I haven't tried it, but you might be able to use one report with the 2
sets of controls in the Detail section.
Set all the changeable controls to not visible.
Then Group the Report by Vendor.
Include a control in the Group Header that counts the Groups records,
= Count(*)
Name this control 'GroupCount'.
Then Code the Group Format event to turn those Detail controls visible
property on or off according to the count:

[ControlA].Visible = [CountGroup] = 1
[ControlB].Visible = [CountGroup] = 1
[ControlC].Visible = [CountGroup] > 1
[ControlD].Visible = [CountGroup] > 1
etc. for as many controls you need to turn on or off.

Set the Group's ForceNewPage property to BeforeSection.
 
Lynne,

If I understand you correctly, it would be possible to design your
report like this...
Use the report's Sorting & Grouping feature to set a Vendor Header
section, and this is where you would put the items:
Re: ______ "To whom it may concern...Enclosed is our check in the amount
of ____ for the month of _____. Sincerely etc."
and
"Enclosed is our check in amount of _(total)_ for month of _____."

Sit these on top of each other in the report design, let's say they are
contained in two textboxes which you name MultiHeader and SingleHeader.
And then, put another hidden textbox in the Vendor Header with Contol
Source =Count(*) and name it DetailCount. Ok, then in the Format event
of the Vendor Header, put code like this...
Me.MultiHeader.Visible = (Me.DetailCount > 1)
Me.SingleHeader.Visible = (Me.DetailCount <= 1)
Me.Section(acDetail).Visible = (Me.DetailCount > 1)

I haven't specifically tested this, but it looks right :-)
I realise your report is probably more complex than what we have
discussed so far, but hope this idea might point you in a useful
direction. Please come back if you need more help.
 
Back
Top