p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 (http://p2p.wrox.com/forumdisplay.php?f=329)
-   -   Chapter 9 - Error Funtion (http://p2p.wrox.com/showthread.php?t=74813)

trechriron June 16th, 2009 06:49 PM

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?

DaveTho June 25th, 2009 12:16 PM

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>

trechriron June 25th, 2009 12:25 PM

I will give that a shot. Thanks!


All times are GMT -4. The time now is 07:16 AM.

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