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, 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?