View Single Post
  #3  
Old August 11th, 2004, 07:26 AM
Jeff Conrad
external usenet poster
 
Posts: n/a
Default KeepTogether property in Report Design View

Ahh haa!!!
Thank you, thank you David!!
That was exactly what I was looking for.
I just had to change it to:

rpt.GroupLevel(0).KeepTogether = 1

Now I'm all finished and happy with it.

Thanks again for the help!

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

"david epsom dot com dot au" david@epsomdotcomdotau wrote in message
...
Both GROUPS and SECTIONS have a KeepTogether property.

The SECTION property takes the values True/False:
rpt.Section(acGroupLevel1Header).KeepTogether = True


The GROUP property takes the values 1/2/3:
rpt.GroupLevel(1).KeepTogether = 1

(david)

"Jeff Conrad" wrote in message
...
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*