A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Category Heading for Each Section



 
 
Thread Tools Display Modes
  #1  
Old April 25th, 2008, 09:31 AM posted to microsoft.public.access.reports
Evi
external usenet poster
 
Posts: 898
Default Category Heading for Each Section

Further thoughts on this.
Although you can't sort a report based directly on a query which has a
subquery, you can base a new query on the query which contains a subquery.
The report based on that can be grouped as normal

Evi

"Evi" wrote in message news:...
Sorry zmerz, I never even knew it wasn't possible until now (I've just

tried
it out).

Here is one solution which you may be able to improve upon.:

In a new Module in your database paste the following:

Option Compare Database
Option Explicit
Dim GlobalFlag As Variant

Function SetFlag(x As Variant)
If GlobalFlag x Then
SetFlag = 1
Else
SetFlag = 0
End If

GlobalFlag = x
End Function

Save and close the Module
Add a text box to your report, in the position where you want the text to
break up.
In Properties name it txtLetter and set Visible to No


In the box type
=Left([Surname],1)
Add another text box, name it txtChange
Make it invisible also
In it, type
=SetFlag(txtLetter)

Set the Can Grow/Can Shrink Property to Yes for the Details section of

your
report and for all the controls in it, including these new ones

Click on the Detail section of your report
In Properties click on Events and next to On Format, open up a code page.
Just above End Sub paste


If Me.txtChange = 1 Then
Me.txtLetter.Visible = True
Else
Me.txtLetter.Visible = False
End If

Evi



"zmerz" wrote in message
...
Hi Evi,

Thanks for the reply. I am unable to use a group header with a

subquery;
the report won't allow it. Any other ideas?


"Evi" wrote:

In the Sorting Grouping box, type
=Left([LastName],1)
Choose Yes next to Group Header
Evi
"zmerz" wrote in message
...
I have a report based on a subquery. In the report I would like to

break
up
the report when the first letter of the last name changes. I am

unable to
group on the last name because of the subquery. I have a subquery

to
combine
the first names of the households. Does anyone know how I can write

my
report? This is what I'm trying to accomplish:

S

Smith, John & Jane

.................................................. .........281-555-1212
1313 Mockingbird Lane

Thanks!








 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:38 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.