|
 |
access thread: Nested Subforms
Message #1 by "David Chapman" <luckychap@b...> on Sat, 18 Jan 2003 07:54:08 -0800
|
|
I am trying to do the impossible again.
I have a master form with two nested subforms. I have always believed this
was possible but have never had a need for it.
The first subform is a single form (as distict from continuous form),
although there is a one to many relation ship between the tables of the
master and first subform. I need to be able to move from one record to the
next on this subform.
I have Record movement buttons on the subform where the "on click" event
executes "DoCmd.GoToRecord acDataForm, "sfWeeklyPays", acNext". This causes
run time error 2489 "the objects 'sfWeeklyPays' isn't open". The code works
when the form is opened outside of the master form. So I conclude that even
though the code is in the subform, it can not reference the form through the
master form. But adding ".form" does not work, neither does addressing the
subform through the forms collection. All attempts generate the same error
message.
The second nested subform works fine - it is a continuous form associated to
the first subform by an indepandant key.
I have noticed that Access forces me to make the first subform a single form
because it contains a subform.
I have to be able browse all records on the subform. Any advice will be
appreciated
David
My spellchecker is fluent in Dyslexia!
Message #2 by "Derrick Flores" <derrickflores@s...> on Sat, 18 Jan 2003 20:38:24 -0600
|
|
David,
I reproduce what you were trying to accomplish and did not run into the same
problems that you were seeing.
This is what I did.
1. Create a single form for Manufactures Names.
2. Created a subform (single form) for Products linking Master to Subform by
MFG_ID.
3. Created a subform within the Products subform and linked it by
Product_ID.
4. Used the wizard to create a navigational button on the Products subform
to view all of the products for each manufacture.
DoCmd.GoToRecord , , acNext
Good Luck,
Derrick Flores
San Antonio, TX
----- Original Message -----
From: "David Chapman" <luckychap@b...>
To: "Access" <access@p...>
Sent: Saturday, January 18, 2003 9:54 AM
Subject: [access] Nested Subforms
> I am trying to do the impossible again.
>
> I have a master form with two nested subforms. I have always believed this
> was possible but have never had a need for it.
>
> The first subform is a single form (as distict from continuous form),
> although there is a one to many relation ship between the tables of the
> master and first subform. I need to be able to move from one record to the
> next on this subform.
>
> I have Record movement buttons on the subform where the "on click" event
> executes "DoCmd.GoToRecord acDataForm, "sfWeeklyPays", acNext". This
causes
> run time error 2489 "the objects 'sfWeeklyPays' isn't open". The code
works
> when the form is opened outside of the master form. So I conclude that
even
> though the code is in the subform, it can not reference the form through
the
> master form. But adding ".form" does not work, neither does addressing the
> subform through the forms collection. All attempts generate the same error
> message.
>
> The second nested subform works fine - it is a continuous form associated
to
> the first subform by an indepandant key.
>
> I have noticed that Access forces me to make the first subform a single
form
> because it contains a subform.
>
> I have to be able browse all records on the subform. Any advice will be
> appreciated
>
> David
>
> My spellchecker is fluent in Dyslexia!
>
>
Message #3 by luckychap@b... on Mon, 20 Jan 2003 09:26:00
|
|
> I am trying to do the impossible again.
I have a master form with two nested subforms. I have always believed this
was possible but have never had a need for it.
The first subform is a single form (as distict from continuous form),
although there is a one to many relation ship between the tables of the
master and first subform. I need to be able to move from one record to the
next on this subform.
I have Record movement buttons on the subform where the "on click" event
executes "DoCmd.GoToRecord acDataForm, "sfWeeklyPays", acNext". This
causes
run time error 2489 "the objects 'sfWeeklyPays' isn't open". The code
works
when the form is opened outside of the master form. So I conclude that
even
though the code is in the subform, it can not reference the form through
the
master form. But adding ".form" does not work, neither does addressing the
subform through the forms collection. All attempts generate the same error
message.
The second nested subform works fine - it is a continuous form associated
to
the first subform by an indepandant key.
I have noticed that Access forces me to make the first subform a single
form
because it contains a subform.
I have to be able browse all records on the subform. Any advice will be
appreciated
David
Thankyou Derrick, you have solved another problem.
The difference between what you tied and what I was failing on was "4.
Used the wizard to create a navigational button". The code produced
defaulted the form name, I was trying to specify it. Its been a valuable
lesson.
|
|
 |