Access VBADiscuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the 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 .
Thanks for your gracious welcome, Bob. I'm doing an exercise in which the authors told me to create a new subroutine called FormFonts, like so:
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 this 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 is suppose to cause the error to occur.
When I ran this code, I received a compile error, "Sub or Function not defined." Can someone tell me what the problem may be?
when you call your sub in the immediate window, is your form in 'create mode' or 'form mode' ?
I try your exercise and when i call the sub in 'creation mode' i receive the same message (procedure or sub not defined) and when i start in 'form mode' and reach the breakpoint (placed in form_load), if i call the sub, i receive the message that your expect (Object doesn't support this property or method).