Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3
This is the forum to discuss the Wrox book Access 2007 VBA Programmer's Reference by Teresa Hennig, Rob Cooper, Geoffrey L. Griffith, Armen Stein; ISBN: 9780470047033
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 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
  #1 (permalink)  
Old June 16th, 2009, 06:49 PM
Registered User
 
Join Date: May 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 9 - Error Funtion

On page 289. The code doesn't compile. The MsgBox with just quotes is not working. The database I am working on is a .mdb file. I have tried putting parans around it, but the VBA editor is still showing it as red.


Quote:
Originally Posted by Book
Code:
Public Sub DisplayUnexpectedError (ErrorNumber as String, ErrorDescription as String)
‘ Note: since this is a universal error handling procedure, it does not have error handling
MsgBox “An error has occurred in this application. “ _ 
& “Please contact your technical support and “ _ 
& “tell them this information:” _ 
& vbCrLf & vbCrLf & “Error Number “ & ErrorNumber & “, “ & 
ErrorDescription, _Buttons:=vbCritical, title:=”My Application”

End Sub

This is copied right from the book.

Any ideas?
  #2 (permalink)  
Old June 25th, 2009, 12:16 PM
Registered User
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Upright quotes

Try using upright single and double quotes.

<code>
Public Sub DisplayUnexpectedError(ErrorNumber As String, ErrorDescription As String)
' Note: since this is a universal error handling procedure, it does not have error handling
MsgBox "An error has occurred in this application. " _
& "Please contact your technical support and " _
& "tell them this information:" _
& vbCrLf & vbCrLf & "Error Number " & ErrorNumber & ", " _
& ErrorDescription, vbCritical, "My Application"
End Sub
</code>
  #3 (permalink)  
Old June 25th, 2009, 12:25 PM
Registered User
 
Join Date: May 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will give that a shot. Thanks!


Similar Threads
Thread Thread Starter Forum Replies Last Post
error with chapter 7 busteronline BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 15 August 21st, 2008 03:22 PM
Using Excell Funtion in VBA coolrks BOOK: Excel 2003 VBA Programmer's Reference 1 February 8th, 2006 11:26 AM
Error: Funtion expected lameneural Classic ASP Databases 4 December 6th, 2005 08:17 PM
weird funtion calling effect/result blur_ivy ASP.NET 1.0 and 1.1 Professional 0 March 6th, 2005 11:19 PM
Parse error in error handler (Chapter 8) Funky Monk BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 August 6th, 2004 08:59 AM





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