Wrox Programmer Forums
BOOK: Access 2003 VBA Programmer's Reference
This is the forum to discuss the Wrox book Access 2003 VBA Programmer's Reference by Patricia Cardoza, Teresa Hennig, Graham Seach, Armen Stein; ISBN: 9780764559037
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2003 VBA Programmer's Reference section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 29th, 2007, 04:07 AM
Registered User
Join Date: Nov 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 11 Pg 334 Running Balance


I have tried to use the Code as given on Page 332 for the running balance in rpts.
The expression On Open you entered as the event property setting produced the following error User defined type not defined

code as I have typed
Option Compare Database
Option Explicit

'Create a variable to hold the running balance.
Dim mdblBalance As Double

Private Function GetStartingBalance()
'Get Starting Balance
GetStartingBalance = -900000.25
End Function
Private Sub Report_Open(Cancel As integer)
' Initalize the running balance to previous balance
mdblBalance = GetStartingBalance
'Set Starting Balance
txtBalance_Starting = mdblBalance
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
'Increase the balance by the current transaction amount
mdblBalance = mdblBalance + txtAmount
'Set the balance to the new balance
txtBalance = mdblBalance
End Sub

Private Sub ReportFooter_Print(Cancel As integer, PrintCount As Integer)
'Set the ending Balance to the final balance amount
txtBalance_Ending = mdblBalance
End Sub

I have managed to find the errors in the code as given in the book.
I have corrected the code and it works beautifully.
If anyone wants the code message me.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 8 pg 282 Step 11 workib BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 May 26th, 2008 04:19 PM
chapter 11 figure 11-7 relative positioning pelopito BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 2 November 29th, 2007 06:11 AM
chapter 5, pg 154 spizotfl BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 3 May 1st, 2007 03:08 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.