Advertisement         >> Go to tutorial

vbWatchdog - Global Error Handler

Transform your VBA error handling.  vbWatchdog offers a robust mechanism for
catching and logging errors that occur in your VBA code on a global scale.

  • No DLLs required - vbWatchdog is coded neatly inside your VBA environment
  • Allows you to log the full callstack that lead up to the exception
  • Reports the values of variables within each procedure on the callstack
  • Offers a Try-Catch paradigm for simplifying local error handling
  • Prevents the Access Runtime from closing on unhandled errors
  • List the exact line number to identify the line of code that failed

Download the FREE Trial             Sample.MDB

 

Your VBA error dialogs could look like this:

vbWatchdog Error Dialog Example


Referring to controls on a subform

by Allen Browne, 20 April 2005
Applies to: All versions
User Level: Easy
Views: 10,832
Rating: **** (7 votes)
Comments: 0   Have your say...

Microsoft Access Tips for Casual Users

Provided by Allen Browne, allen@allenbrowne.com


Referring to Controls on a Subform

Sooner or later, you will need to refer to information in a control on another form - a subform, the parent form, or some other form altogether. Say for example we have a form called "Students" that displays student names and addresses. In this form is a subform called "Grades" that displays the classes passed and credit points earned for the student in the main form. How can the Students form refer to the Credits control in the Grades subform?

Access refers to open forms as "Forms". Using the dot as a separator, the Surname control on the Students form can be referenced as:

    Forms.Students.Surname

If there are spaces in the names of your objects, use square brackets around the names, e.g.:

    Forms.[Students Form].[First Name]

Now, the area on a form that contains a subform is actually a control too: just have a look at it in design view. This control has a ".form" property which refers to the form that it holds. This ".form" must be included if you wish to refer to controls in the subform. For example:

    Forms.Students.Grades.Form.Credits

where "Students" is the name of the parent form, "Grades" is the name of the control that holds the subform, and "Credits" is a control on the subform.

Once you get the hang of referring to things this way, you will use it incessantly, to SetValue in macros, to print a report limited to a certain financial period (the WHERE clause in the OpenReport action) etc.

In code, you can use Me and Parent to shorten the references. See Help in the VBA window for details.


Home Index of tips Top

Please Note: This is a cached tutorial (reproduced with permission).
To view the tutorial at its original location click here.



Rate this article:   Your rating: Poor Your rating: Not so good Your rating: Average Your rating: Good Your rating: Excellent

Have your say - comment on this article.

What did you think of 'Referring to controls on a subform'?

No comments yet.

Why not be the first to comment on this article?!

Have your say...

Name
E-mail (e-mail address will be kept private)
Comments
Verify Code
Verification Code
Please note: It may take 30 seconds after clicking submit - please be patient to avoid duplicate submissions.   All comments must be approved before being displayed on this web page.  This process may take up to 24 hours.


Site tools

SmartAccess
300+ articles.
Promo code EA-45K2D46TVS