Programmatic access Linked Master / Child fields in Access
How do I programmatically get the current linked value on a subForm in access. The documented string property subForm.LinkMasterFields t开发者_开发技巧hrows an error when I try to reference it.
LinkMasterFields will give you the name of the field it's linking on. Try this and see what it says
MsgBox Me.subForm.LinkMasterFields
If you want to get a value from a field on the subform you can get it like this
MsgBox Me.subForm.Form.field_1
or directly with
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.
精彩评论