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 June 30th, 2009, 01:52 PM
Registered User
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default custom form property

I have a regular form called "Fish". It has a TreeCtl called "loctree" which I used as a location chooser to populate another control on Fish.

I've since added several subforms to Fish. Two of these have location fields that I would like to use loctree for. Since I didn't want to instantiate a TreeCtl for each of these subforms, I thought I could just let loctree know which control its current target is. I thought the easiest way to define the current target would be to add a property to my Fish form:

Code:
 
Option Compare Database
 
Private locfield As Field
 
Property Let loc_focusField(target As Field)
    locfield = target
End Property
 
Property Get loc_focusField()
    loc_focusField = locfield
End Property
And then in the Open Event for the Fish form, I could set the default value of locfield:

Code:
 
Private Sub Form_Open(Cancel As Integer)
  locfield = Forms!fish_moves!fish_moves_loc_id
End Sub
Unfortunately, every time I try to open my form I get the following error:

Quote:
Definitions of property procedures
Quote:
for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid Set final parameter
So what gives?

Thanks,
Jen

Last edited by dnagirl; June 30th, 2009 at 02:29 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Server Control....Custom Property Editor ZArrinPour ASP.NET 1.0 and 1.1 Basics 1 June 15th, 2010 11:30 AM
Property in Custom control watashi Visual C++ 0 October 22nd, 2008 11:20 PM
Making a custom ImageKey property? jacob C# 0 February 27th, 2006 09:04 AM
Setting Property for a Custom Control cadaats C# 0 October 17th, 2005 02:22 AM
Create an About property for custom control mouratx General .NET 1 March 27th, 2004 11:18 PM





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