Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

link child fields

Status
Not open for further replies.

djam

Technical User
Nov 15, 2002
223
CA
Anyone know the code in vb to set the linkchildfields and linkmasterfields property??

thanks
 
me.subformename.LinkChildFields="childfieldname"
me.subformename.LinkmasterFields="masterfieldname"
 
Hi,

Can't see this working.

If it does, please respond with a post.

Regards,

Darrylles "Never argue with an idiot, he'll bring you down to his level - then beat you with experience." AND "A pointer to a solution is better than the solution - you'll remember the solution via a pointer". darrylles@totalise.co.uk
 
it works try requerying form ect.
i just tried it
 
Hi pwise,

Your code works perfectly, this pedantry is catching. Why not, if the SourceObject is likely to be variable, add:

me.subformename.SourceObject="sourceobjectname"

before linking the child and master fields.


 
Hi,

Glad it does work.

Why then, when referring to controls on subforms do you need to use 'subform!form.control'?

I've always found it difficult to remember this syntax.

Regards,

Darrylle "Never argue with an idiot, he'll bring you down to his level - then beat you with experience." AND "A pointer to a solution is better than the solution - you'll remember the solution via a pointer". darrylles@totalise.co.uk
 
i have found that refering to forms!formname.controlname works only sometimes if that is what you want to refer to
dont know why
that is if you want to refer by forms!formname.controlname
i dont know exactly how you want to refer by
 
this is what I tried and it didn't work,

Me.mainform.LinkChildFields = "id"
Me.mainform_sub.LinkMasterFields = "id"

the error says that the method or data member is not found(just after the Me. it is highlighted) "so many events, so little time"
 
Me.mainform.LinkChildFields = "id"
Me.mainform_sub.LinkMasterFields = "id"
Won’t work because LinkChildFields & LinkMasterFields are properties of the subform control
I should have written
me.subformcontrolname.LinkChildFields="childfieldname"
me.subformcontrolname.LinkmasterFields="masterfieldname"
'subform!form.control
Refers to the form embedded in subform control
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top