作者:鐘文斌kebenJ | 来源:互联网 | 2023-05-18 16:37
I have a regular form called "Fish". It has a TreeCtl called "loctree" which I used as a location chooser to change a field in Fish.
我有一个名为“鱼”的常规表格。它有一个名为“loctree”的TreeCtl,我用它作为位置选择器来更改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 new 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:
我已经为Fish添加了几个子表单。其中两个有我想使用loctree的位置字段。由于我不想为每个子表单实例化一个新的TreeCtl,我想我可以让loctree知道它当前目标是哪个控件。我认为定义当前目标的最简单方法是在Fish表单中添加一个属性:
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:
然后在Fish窗体的Open事件中,我可以设置locfield的默认值:
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:
不幸的是,每次我尝试打开表单时都会出现以下错误:
Definitions of property procedures for the same property are inconsistent, or property procedure has an optional parameter, a ParamArray, or an invalid Set final parameter
相同属性的属性过程的定义不一致,或者属性过程具有可选参数,ParamArray或无效的Set final参数
So what gives?
什么给出了什么?
Thanks, Jen
1 个解决方案