Change subform properties "Link Master Fields" and "Link Child Fie

G

Guest

How to change, using VB code, the subform control properties "Link Master
Fields" and "Link Child Fields"? I haven't found in the Access Help.

I have tried the code below ("Sub Performance Reporting" is the name of the
subform control):

Me.[Sub Performance Reporting].Form.LinkChildFields = "Code;Country;Channel"
Me.[Sub Performance Reporting].Form.LinkMasterFields
"Campo17;Combo28;Combo30"


Thanks in advance,
 
R

Roger Carlson

The LinkChildFields and LinkMasterFields properties are properties of the
subform control, not the subform that is IN the control. When you add the
..Form to the end of the subcontrol, you are telling Access you want to enter
the acutal subform. Therefore, your code should be something like this:

Me.[Sub Performance Reporting].LinkChildFields = "Code;Country;Channel"
Me.[Sub Performance Reporting].LinkMasterFields = "Campo17;Combo28;Combo30"

I don't have a sample subform that links on multiple fields, so I can't
verify that the strings after the equal signs are formatted properly.
However, the above DOES work with a single linking field.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top