Can't figure out nested subform and requery syntax

B

bj

I received the layout idea outlined below from this list
and cannot find the right syntax to make it work any
help? My aim is to use subforms to access child data and
I would like the action to imitate that of nested subforms
each residing on its parent . . . BUT, I do not want the
subforms to actually reside on their respective parents.

I have a Main form that is unbound. On this frmMain I
have 6 subforms, 5 on a first tab control and the 6th on
another tab control.

On the first tab, the top level form is frmA. It has, in
it's detail section, one direct child, frmB. Next to frmB
(in the same detail section, so, not physically located on
frmB), lies frmC, which is a child of frmB. Next to frmC,
lies it's child, frmD. Next to frmD, lies it's child,
frmE. Finally, frmF, lies on a separate tab and is a
child of frmE. So, the relationships are A -> B -> C ->
D -> E -> F. Only frmB lies physically on it's parent.

I've tried this general syntax in the parent link textbox
on forms C-F (using frmC as an example): forms!frmA!
frmB.form!frmC.form!ctrlName where ctrlName is the name of
the linking parent field on frmB. I also tried inserting
a Requery method(since this doesn't seem to happen
automatically if a subform does not reside on it's parent)
in the Current event of the parent forms where
appropriate. That generates an error the error listed
below.** So, this doesn't work. (Btw, I have been
careful to use the control name for the subforms -- where
that differs from the form name itself -- in the syntax.)

I have also tried inserting forms!frmMain at the very
beginning since frmA actually is a subform of frmMain (the
unbound container for all this), but that didn't work
either ("didn't work" means that my subform records don't
update when I click the navigation button to advance to
the next record).

**"The expression OnCurrent you entered as the event
property setting produced the following error: A problem
occurred while Microsoft Access was communicating with the
OLE Server or ActiveX control."
 
J

Jonathan Parminter

-----Original Message-----
I received the layout idea outlined below from this list
and cannot find the right syntax to make it work any
help? My aim is to use subforms to access child data and
I would like the action to imitate that of nested subforms
each residing on its parent . . . BUT, I do not want the
subforms to actually reside on their respective parents.

I have a Main form that is unbound. On this frmMain I
have 6 subforms, 5 on a first tab control and the 6th on
another tab control.

On the first tab, the top level form is frmA. It has, in
it's detail section, one direct child, frmB. Next to frmB
(in the same detail section, so, not physically located on
frmB), lies frmC, which is a child of frmB. Next to frmC,
lies it's child, frmD. Next to frmD, lies it's child,
frmE. Finally, frmF, lies on a separate tab and is a
child of frmE. So, the relationships are A -> B -> C ->
D -> E -> F. Only frmB lies physically on it's parent.

I've tried this general syntax in the parent link textbox
on forms C-F (using frmC as an example): forms!frmA!
frmB.form!frmC.form!ctrlName where ctrlName is the name of
the linking parent field on frmB. I also tried inserting
a Requery method(since this doesn't seem to happen
automatically if a subform does not reside on it's parent)
in the Current event of the parent forms where
appropriate. That generates an error the error listed
below.** So, this doesn't work. (Btw, I have been
careful to use the control name for the subforms -- where
that differs from the form name itself -- in the syntax.)

I have also tried inserting forms!frmMain at the very
beginning since frmA actually is a subform of frmMain (the
unbound container for all this), but that didn't work
either ("didn't work" means that my subform records don't
update when I click the navigation button to advance to
the next record).

**"The expression OnCurrent you entered as the event
property setting produced the following error: A problem
occurred while Microsoft Access was communicating with the
OLE Server or ActiveX control."
.
hi bj,
try having a textbox for each subform from C to E (using
your referencing). Each will have a control source that
references a linking field. For example.

control: txtLinkFromBToC
source: =frmA.form!frmB.form!ctrlName

Then have subform control, frmC link master field
=txtLinkFromBToC

Repeat for each...

Luck
Jonathan
 

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