Wrox Programmer Forums
|
Access VBA Discuss 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2009, 12:51 PM
Registered User
 
Join Date: Jul 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VBA Coding Technique Question

I am working with an Access 2000 database written by someone else. Although I've done alot of VBA programming over the years I am running into things this person did that I don't quite understand. He is obviously at a higher level than myself. My specific question is:

In a form with multiple subforms the original programmer doesn't directly access the properties of the subforms in his code. Instead he uses the following code to create an instance of the subforms:

Code:
   Private Function DetailsSheet() As Form_frmRADetailSheet
      If mfrmRADetails Is Nothing Then
          Set mfrmRADetails = Me!subRADetailSheet.Form
          Set mfrmRADetails_Class = mfrmRADetails
      End If
      Set DetailsSheet = mfrmRADetails
  End Function
The subform being accessed is "frmRADetailSheet" and the identifier he uses to access the properties of the subform is "DetailsSheet". Can someone tell me why you would want to access the properties this way instead of accessing them directly like this:

Code:
   Me.subRADetailSheet.Form.Property
??

I am interested in this because one of our users continually gets Error#2467, object closed or doesn't exist, when this code is executed and I've narrowed it down to the statements setting the properties of the subform mentioned above.

Thanks in advance for your comments.

Last edited by gcoggin; July 29th, 2009 at 12:55 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Help! Coding queries in vba for subforms froy001 Access VBA 3 May 1st, 2009 08:04 AM
Organization chart in Excel through VBA coding mangesh.gohad Excel VBA 0 July 26th, 2008 12:23 PM
What does (Me!) and (Dim)stand for in VBA Coding? srswedeen Access VBA 1 October 14th, 2005 06:41 AM
Coding question aagway Access VBA 1 May 4th, 2004 02:54 PM
event coding - Access VBA bph Access VBA 5 January 6th, 2004 12:17 PM





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