P
pmcguire
I have a form with a TabControl (eg. tabControl1) on it. It also has 2 Subform controls on it. At runtime, the Subforms appear to be placed on individual tab pages. Depending on on the value of tabControl1, various properties of on or both of the Subforms are changed
For example
select case tabControl
case
subForm1.Top=1.75 * 144
subForm1.SourceObject="frmMySubform11
subForm1.LinkMasterFields="MasterID11;MasterID12
subForm1.LinkChildFields="ChildID11;ChildID12
case
subForm1.Top=2 * 144
subForm1.SourceObject="frmMySubform12
subForm1.LinkMasterFields="MasterID11
subForm1.LinkChildFields="ChildID11
end selec
Unfortunately, this code works inconsistently. It appears that it might be execution order dependent. In particular, I have had to anticipate an error that is raised because I change the number of link fields in, say, the LinkMasterFields property without simultaneously changing it in the LinkChildFields property (as far as I know, it is not possible to change these properties simultaneously at runtime). I have worked around this one, but another is the repositioning, which sometimes works and sometimes doesn't, and I don't know why
What is wrong with my code? Is there a better way
Thanks
Pat
For example
select case tabControl
case
subForm1.Top=1.75 * 144
subForm1.SourceObject="frmMySubform11
subForm1.LinkMasterFields="MasterID11;MasterID12
subForm1.LinkChildFields="ChildID11;ChildID12
case
subForm1.Top=2 * 144
subForm1.SourceObject="frmMySubform12
subForm1.LinkMasterFields="MasterID11
subForm1.LinkChildFields="ChildID11
end selec
Unfortunately, this code works inconsistently. It appears that it might be execution order dependent. In particular, I have had to anticipate an error that is raised because I change the number of link fields in, say, the LinkMasterFields property without simultaneously changing it in the LinkChildFields property (as far as I know, it is not possible to change these properties simultaneously at runtime). I have worked around this one, but another is the repositioning, which sometimes works and sometimes doesn't, and I don't know why
What is wrong with my code? Is there a better way
Thanks
Pat