MS Access linking subforms

rdr

Joined
Sep 5, 2005
Messages
1
Reaction score
0
Hi,
I have a form with several subforms, each of the subforms on a separate page of a tab control.
Some of the subforms have to be linked to the main form using one child/master field; some of the subforms - using three child/master fields.
I am trying to change the number of the fields to be linked when the TabContron is changed:

Private Sub TabCtl_Change()
Select Case TabCtl
Case 0, 1, 4
TabCtrlSubForm.SourceObject = TabCtl.Pages(TabCtl).Tag
TabCtrlSubForm.LinkMasterFields = "lstTeachers;txtCN;txtON"
TabCtrlSubForm.LinkChildFields = "Id number;Custom Number;OccupNo"
Case 2, 3, 5, 6, 7
TabCtrlSubForm.SourceObject = TabCtl.Pages(TabCtl).Tag
TabCtrlSubForm.LinkMasterFields = "lstTeachers"
TabCtrlSubForm.LinkChildFields = "Id number"
End Select
End Sub

But it is not working - the form still "remembers" the previous number of fields and does not switch to the new one.
Does anyone have an idea if this is possible to be done, and if yes, which is the proper event?

Thanks a lot,
Radosveta Drakeva
 

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