Making the Detail invisible but showing the calculated totals.

T

TrussworksLeo

Hello,

Does anyone know how to make the detail section of a report visible = false and still get the totals in the report???

Here is the code to make the detail section invisible but it does not print totals calculated in the detail section???

'Sum or Detail Selection
sUserName = GetUserName()
SumDet = GetGlobalVariable(sUserName, "SumDetSelection")
If SumDet = True Then
Me.Detail.Visible = False
Else
Me.Detail.Visible = True
End If
'End Detail Selection
End Sub
--
Thank You, Leo




------ The whole report code.

Option Compare Database
Option Explicit
Dim SRTotal
Dim OrdersTotal
Dim QuotesNumofJobs
Dim OrdersNumofJobs
Dim sUserName As String
Dim SumDet As Boolean
Private fGray As Integer

Private Sub AlternateGray()
Const adhcColorGray = 14671839
Const adhcColorWhite = &HFFFFFF
On Error GoTo Err_AlternateGray
Me.Section(0).BackColor = IIf(fGray, adhcColorGray, adhcColorWhite)
fGray = Not fGray
Err_AlternateGray:

End Sub

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

AlternateGray
If IsNull(QuotedPrice) Or QuotedPrice = 0 Then
Me!sQuotedPrice = Me!DesignPrice
Else
Me!sQuotedPrice = Me!QuotedPrice
End If
Me![sGuessPrice] = Format(Me![Guess Price], "Currency")
Me![sQuotedPrice] = Format(Me!sQuotedPrice, "Currency")
Me!sGuessPrice = IIf([sGuessPrice] = 0, "", [sGuessPrice])
If Nz(Me!sQuotedPrice, 0) = 0 Or Len(Me!sQuotedPrice) = 0 Then
Me!sGuessPrice.Visible = True
Me!sQuotedPrice.Visible = False
Else
Me!sGuessPrice.Visible = False
Me!sQuotedPrice.Visible = True
End If

'Sum or Detail Selection
sUserName = GetUserName()
SumDet = GetGlobalVariable(sUserName, "SumDetSelection")
If SumDet = True Then
Me.Detail.Visible = False
Else
Me.Detail.Visible = True
End If
'End Detail Selection
End Sub
Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
Dim SGPrice
SGPrice = IIf(IsNull(sGuessPrice) Or Trim(sGuessPrice) = "", 0, sGuessPrice)
SRTotal = SRTotal + (IIf(sQuotedPrice = 0 Or Len(sQuotedPrice) = 0, SGPrice, Nz(sQuotedPrice)))
End Sub
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)
TPrice = SRTotal
sreporttotal = OrdersTotal
sReportNumofJobs = OrdersNumofJobs
sQuotesNumofJobs = QuotesNumofJobs
If Me.Page = 1 Then
Me.Label518.Visible = False
Else
Me.Label518.Visible = True
End If
End Sub
Private Sub ReportFooter_Print(Cancel As Integer, PrintCount As Integer)
OrdersTotal = Me.TPrice + Sub_Lay_Out_for_Approval.Report!TPrice + Sub_Eng_BL.Report!TPrice + Sub_In_Transit.Report!TPrice + Sub_Build_BL.Report!TPrice + _
Sub_Ship_BL.Report!TPrice
OrdersNumofJobs = Me.sNumofJobs + Sub_Lay_Out_for_Approval.Report!sNumofJobs + Sub_Eng_BL.Report!sNumofJobs + Sub_In_Transit.Report!sNumofJobs + Sub_Build_BL.Report!sNumofJobs + _
Sub_Ship_BL.Report!sNumofJobs
QuotesNumofJobs = Sub_Bid_BL.Report!sNumofJobs + Sub_Lay_Quotes_BL.Report!sNumofJobs
End Sub
Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
OrdersTotal = 0
SRTotal = 0
QuotesNumofJobs = 0
OrdersNumofJobs = 0
End Sub




Expand AllCollapse All


Manage Your Profile |Legal |Contact Us |MSDN Flash Newsletter
©2004 Microsoft Corporation. All rights reserved. Terms of Use |Trademarks |Privacy Statement
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top