Senin, 21 Mei 2012

RE: [MS_AccessPros] Re: Insert a label within report detail lines

 

Phucon-

You could design your Detail section with a line across the top and a label that
both have the Visible property set to No. In the Format event of the Detail
section, put this:

Option Compare Database
Option Explicit
Dim intG50 As Integer ' Module level variable

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
' If line not displayed before
If Not intG50 Then
' See if we have exceeded the value
If Me.Amount > 50 Then
' Show the line and label
Me.lbl50.Visible = True
Me.lin50.Visible = True
' Set variable to show we've done it
intG50 = True
End If
Else
' Make sure line and label are not visible
Me.lbl50.Visible = False
Me.lin50.Visible = False
End If
End Sub

John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Paris, France)

From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of cc
Sent: Monday, May 21, 2012 11:09 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Re: Insert a label within report detail lines

 

Hello Duane

It is simply a numeric value, the value (500) could happen twice if 2 customers
have the same amount.

The report that I have been trying to achieve is, seperate the detail lines into
2 sections, it first prints the detail lines that have value <= 500,(1 to 499
for example) and when it's over 500 then prints the label and then print the
detail lines which > 501 to 1000...

Thanks

--- In MS_Access_Professionals@yahoogroups.com, "Duane" <duanehookom@...> wrote:
>
> Are the Amount values in a increasing order so 500 will be hit only once? Is
this a running sum or just a simple numeric value?
>
> Duane Hookom
> MS Access MVP
>
> --- In MS_Access_Professionals@yahoogroups.com, "cc" <saigonf7q5@> wrote:
> >
> > Good morning all
> >
> > I have a report's record source is based on a query that has a column named
"Amount". I am wondering if it's possible to program the report to insert a
label or column headings after the detail lines meet a specific criterion. For
example, the value of the "Amount" field has a range from 1 to 1000, when the
Amount reaches 501, then insert a label "Amount greater than 500". Can this be
done within report?
> >
> > Phucon
> >
>

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar