View Single Post
  #1  
Old August 10th, 2004, 08:29 PM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default Q2: KeepTogether property in Report Design View

Hi,

Using Access 97 at the moment, but this project will also be compatible for 2000+.

This project is an Access Add-In I made and everything works fine except for a couple of tiny
issues.

I'm creating a report completely in code and I am unable to set the KeepTogether property for a
group to "Whole Group." This is found when you go to the Sorting/Grouping dialog box. Nothing I have
tried seems to make a difference. For illustration purposes try this code from the immediate window:

Public Function funcTest2()

Dim rpt As Report
Dim varGroupLevel As Variant

' Start the process of creating report in Design View
Set rpt = CreateReport

' Create the first Grouping Level
varGroupLevel = CreateGroupLevel(rpt.Name, "FirstField", True, False)
' Set the Keep Together Property to Whole Group
rpt.Section(acGroupLevel1Header).KeepTogether = True

End Function

On the last line the IntelliSense only presents True/False as the options. Well this is only setting
the KeepTogether property to True. If you right click on that first header group you'll see it now
says Yes on that specific line. However, what I'm trying to do is set KeepTogether property to
"Whole Group" which appears to only be found in the Sorting/Grouping dialog box.

Hitting F1 on that line and reading the Help files says I should set that property to 1 for "Whole
Group." I've tried that and it still does not work. The Help file also says I can set this property
in Report Design View. So how do you do that?!!

I'm sure I could make some code in the Open event to accomplish this, but my first choice is to take
care of everything when I create the report entirely in code.

Any help is appreciated and thanks for your time.

--
Jeff Conrad
Access Junkie
Bend, Oregon
*282 Days Left*