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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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 | |
|
|