Form & Multiple sub-forms

G

Guest

I have created a main form and added two subforms. I have linked form1 to
the main form using the Master Fields/Child Fields links. On form2 i wish to
have the user enter information in existing fields (not adding records). I
have linked form2 to form1 on common fields. I am able to see the
information, but the form is not updateable. Can someone tell me why?

The other problem is with the synchronization between the two forms. As i
move my cursor through records in form1, synchroization of data with form2 is
not happening.

Can anyone help me? Thanks in advance
 
M

Marshall Barton

faberk said:
I have created a main form and added two subforms. I have linked form1 to
the main form using the Master Fields/Child Fields links. On form2 i wish to
have the user enter information in existing fields (not adding records). I
have linked form2 to form1 on common fields. I am able to see the
information, but the form is not updateable. Can someone tell me why?

The other problem is with the synchronization between the two forms. As i
move my cursor through records in form1, synchroization of data with form2 is
not happening.


There is something wrong with the way you are linking form2
to form1. If you'll explain how you're trying to do that,
maybe someone will be able to straighten it out.
 
G

Guest

Sorry for the delay.

Main form named frmPDE. It's recordsource is a table named tblRegions. The
fields in this table are: RegionID; RegionDescr

Text box on the main form based on the RegionDescr field, which the main
form is based on. I will use navigation button to move between records.

The first subform is named frmPDEMkts. Field List: RegionId; MktLEvel;
MktArea; MktArea; MktAreaDescr, etc. Link Child Fields: RegionId. Link
Master fields: RegionId

the second subform is named frmPDEData. Field List:
MktLevel;MktArea;ProdGrp, Currency, Jan, Feb, etc. Link Child Fields:
MktLevel;MktArea. Link Master Fields:
[frmPDEMkts].Form![MktLevel];[frmPDEMkts].Form![MktArea]

The subform frmMkts works with no problems, but i cant get the frmPDEData to
work. I loooked at the MS sample database, which had a similar
configuration. It was working, but it would not allow the user to change
records in the child form. I need to do that also. Any help would be
greatly apprciated. Thanks



The 1st subform is named frmPDEMkts.
 
G

Guest

ugh...CORRECTION:

The first subform is named frmPDEMkts. Field List: RegionId; MktLEvel;
MktArea; MktAreaDescr, etc. Link Child Fields: RegionId. Link
Master fields: RegionId




faberk said:
Sorry for the delay.

Main form named frmPDE. It's recordsource is a table named tblRegions. The
fields in this table are: RegionID; RegionDescr

Text box on the main form based on the RegionDescr field, which the main
form is based on. I will use navigation button to move between records.

The first subform is named frmPDEMkts. Field List: RegionId; MktLEvel;
MktArea; MktArea; MktAreaDescr, etc. Link Child Fields: RegionId. Link
Master fields: RegionId

the second subform is named frmPDEData. Field List:
MktLevel;MktArea;ProdGrp, Currency, Jan, Feb, etc. Link Child Fields:
MktLevel;MktArea. Link Master Fields:
[frmPDEMkts].Form![MktLevel];[frmPDEMkts].Form![MktArea]

The subform frmMkts works with no problems, but i cant get the frmPDEData to
work. I loooked at the MS sample database, which had a similar
configuration. It was working, but it would not allow the user to change
records in the child form. I need to do that also. Any help would be
greatly apprciated. Thanks



The 1st subform is named frmPDEMkts.

Marshall Barton said:
There is something wrong with the way you are linking form2
to form1. If you'll explain how you're trying to do that,
maybe someone will be able to straighten it out.
 
G

Guest

I solved this. as it turns out, i needed an "on current" action to requery
the sub-sub form. Thanks for your time Marshall
 
M

Marshall Barton

Right, the issue is that a Link Master needs to be a control
on the main form.

Add two hidden text boxes to the main form's header section.
Name them txtLevel and txtArea. Then add code to the
Current event procedure in frmPDEMkts:
Parent.txtLevel = Me.MktLevel
Parent.txtArea = Me.MktArea

I think that's all you need to do.
--
Marsh
MVP [MS Access]

Main form named frmPDE. It's recordsource is a table named tblRegions. The
fields in this table are: RegionID; RegionDescr

Text box on the main form based on the RegionDescr field, which the main
form is based on. I will use navigation button to move between records.

The first subform is named frmPDEMkts. Field List: RegionId; MktLEvel;
MktArea; MktArea; MktAreaDescr, etc. Link Child Fields: RegionId. Link
Master fields: RegionId

the second subform is named frmPDEData. Field List:
MktLevel;MktArea;ProdGrp, Currency, Jan, Feb, etc. Link Child Fields:
MktLevel;MktArea. Link Master Fields:
[frmPDEMkts].Form![MktLevel];[frmPDEMkts].Form![MktArea]

The subform frmMkts works with no problems, but i cant get the frmPDEData to
work.

Marshall Barton said:
There is something wrong with the way you are linking form2
to form1. If you'll explain how you're trying to do that,
maybe someone will be able to straighten it out.
 
M

Marshall Barton

That's generally more work than required. If it works, it
usually means that form2's record source query has some
criteria that attempts to take the place of the Link
Master/Child properties. I think(?) it's a little more
efficient to use the Link Master/Child properties instead of
criteria in the query because it at least gives Access an
opportunity to optimize the requery.

This is the first time you've used the term "sub-sub form".
Does this mean that form2 is being display inside Form1? I
thought that Form1 and form2 were both displayed as separate
subforms on the main form. If I misunderstood the
arrangement of your subforms, then my previous answer was
not applicable to a main form - subform - subsubform. In
this case the Link Master property should be a text box on
form1.
 

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