程序访问Access中的链接主/子字段

时间:2010-04-20 16:05:52

标签: ms-access

如何以编程方式获取访问中的子窗体上的当前链接值。当我尝试引用它时,记录的字符串属性subForm.LinkMasterFields会引发错误。

1 个答案:

答案 0 :(得分:1)

LinkMasterFields将为您提供其链接字段的名称。试试这个并看看它的内容

MsgBox Me.subForm.LinkMasterFields

如果你想从子表单的字段中获取值,你可以像这样得到它

MsgBox Me.subForm.Form.field_1

或直接与

MsgBox subFormRealName.Form.field_1

''// n.b.: you're running with scissors if you do this - especially if you have 
''// the possibility of having the same subForm open multiple times at once
''// e.g., on the same form or on two different forms at once.