Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > BOOK: Beginning Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Access VBA
This is the forum to discuss the Wrox book Beginning Access 2002 VBA by Robert Smith, Dave Sussman, Ian Blackburn, John Colby, Mark Horner, Martin Reid, Paul Turley, Helmut Watson; ISBN: 9780764544026
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 10th, 2004, 11:52 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning Access 2002 VBA Chapter 5

On page 197 of Chapter 5, Try It Out, the first instruction is to create a new subroutine called FormFonts, like so:

Public Sub FormFonts(strFont As String)

Dim frmCurrent As Form
  Dim ctlControl As Control

  For Each frmCurrent In Forms
    For Each ctlControl In frmCurrent.Controls
      ctlControl.FontName = strFont
    Next
  Next
End Sub

Next, we are told to use the immediate window to run the code. The authors indicate that running the code should generate the following error message: "Run-time error '436' Object doesn't support this property or method" and then explain why this is so. Despite the error, however, text of the form's text boxes and labels should reflect change up to the control that caused the error.

When I ran this code, I received a compile error, "Sub or Function not defined." Can someone tell me what the problem may be?

Thanks.



Reply With Quote
  #2 (permalink)  
Old August 16th, 2004, 01:49 PM
Authorized User
 
Join Date: Oct 2003
Location: London, , United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What a coincidence, I too am having that very same problem. I think it has something to do with "ctlControl.Font = strFont" as Font does not appear in the drop down menu after after Control. I have looked in References and cannot see any reference to it in DAO (which I believe is what we are supposed to be using, or am i wrong?), but I am lost.

Reply With Quote
  #3 (permalink)  
Old August 16th, 2004, 02:20 PM
Authorized User
 
Join Date: Oct 2003
Location: London, , United Kingdom.
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, I have rewritten the code and hey presto....it works. Don't ask me how, but it does

tony

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning Access 2002 VBA Chapter 3 Olivia54 BOOK: Beginning Access VBA 3 January 24th, 2006 11:11 AM
Beginning Access 2002 VBA Code pajiyar BOOK: Beginning Access VBA 0 July 12th, 2004 08:04 AM
Beginning Access VBA 2002 Database File sristm BOOK: Beginning Access VBA 0 March 30th, 2004 11:08 PM
Does anyone have the Beginning Access 2002 VBA CD? sristm Access VBA 0 March 21st, 2004 03:27 PM



All times are GMT -4. The time now is 04:37 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.