Connecting Tech Pros Worldwide Help | Site Map

Two Subforms - Same Record

Steve
Guest
 
Posts: n/a
#1: Nov 12 '05
I have a form, primary subform and secondary subform. A tab control takes up all
the area of the primary subform. There are about 15 tabs on the tabcontrol. Each
tab contains fields from the same table. Related fields appear on each tab.
There is one field in the table that needs to be displayed at all times so I
created the secondary subform (subform to main form) to display just that one
field. Data entry is main form - secondary subform - main subform. When enter a
new record, data is first entered in the main form. Next a value is entered in
the secondary subform. Finally data entry is completed in the primary subform. A
problem occurs here. The primary subform goes to a new record rather than
staying on the same record as the secondary subform. How can I get the primary
subform to stay on the same record as the secondary record so the data entered
in the primary subform is recorded in the same record as the data that was
entered in the secondary subform.

Thanks for all help!

Steve


John Vinson
Guest
 
Posts: n/a
#2: Nov 12 '05

re: Two Subforms - Same Record


On Tue, 11 May 2004 21:56:41 GMT, "Steve" <spam@nospam.spam> wrote:
[color=blue]
>I have a form, primary subform and secondary subform. A tab control takes up all
>the area of the primary subform. There are about 15 tabs on the tabcontrol. Each
>tab contains fields from the same table. Related fields appear on each tab.[/color]

WHOA. How many fields in your table!? FIFTEEN tab controls - you must
be pushing the 255 field limit, and (much more insidiously) the 2000
characters per record limit. Are you certain that your table is
properly normalized?
[color=blue]
>There is one field in the table that needs to be displayed at all times so I
>created the secondary subform (subform to main form) to display just that one[/color]

It is not necessary to have a separate subform to do this, and I'd in
fact advise against it. It's perfectly possible to put this one field
on the Form *NOT* on the tab control; or, if you prefer, you can put
fifteen controls all bound to the same field, one on each tab page.
Having the same record open simultaneously on two subforms can and
will (as you have seen) get you into synchronization trouble!

John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
Steve
Guest
 
Posts: n/a
#3: Nov 12 '05

re: Two Subforms - Same Record


John,

Thanks for responding! You misread my post, there's not 15 tab controls; there's
only one with 15 tabs. The table has around 60 fields so each page of the tab
control only has a couple of fields. The design of the tab control takes up all
the area of the primary subform so there's no room to put the one field outside
the tab control.

I am going to look at implementing your suggestion of fifteen controls all bound
to the same field, one on each tab page. Is there any way to put a textbox on
the main form but bind it to a field in the recordsource of the subform? Maybe
something like Forms!MyMainForm!MySubformControl!MyField in the control source
property???

In the way of synchronized subforms, is there a way to make two subforms based
on the same record source always be on the same record, ie, data entry in either
subform will always record data in the same underlying record?

Thanks, John,

Steve


"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:1dv2a0pnsgmkeq3sekcalhsii1c7amacju@4ax.com...[color=blue]
> On Tue, 11 May 2004 21:56:41 GMT, "Steve" <spam@nospam.spam> wrote:
>[color=green]
> >I have a form, primary subform and secondary subform. A tab control takes up[/color][/color]
all[color=blue][color=green]
> >the area of the primary subform. There are about 15 tabs on the tabcontrol.[/color][/color]
Each[color=blue][color=green]
> >tab contains fields from the same table. Related fields appear on each tab.[/color]
>
> WHOA. How many fields in your table!? FIFTEEN tab controls - you must
> be pushing the 255 field limit, and (much more insidiously) the 2000
> characters per record limit. Are you certain that your table is
> properly normalized?
>[color=green]
> >There is one field in the table that needs to be displayed at all times so I
> >created the secondary subform (subform to main form) to display just that one[/color]
>
> It is not necessary to have a separate subform to do this, and I'd in
> fact advise against it. It's perfectly possible to put this one field
> on the Form *NOT* on the tab control; or, if you prefer, you can put
> fifteen controls all bound to the same field, one on each tab page.
> Having the same record open simultaneously on two subforms can and
> will (as you have seen) get you into synchronization trouble!
>
> John W. Vinson[MVP]
> Come for live chats every Tuesday and Thursday
> http://go.compuserve.com/msdevapps?loc=us&access=public[/color]


tina
Guest
 
Posts: n/a
#4: Nov 12 '05

re: Two Subforms - Same Record


Is there any way to put a textbox on[color=blue]
> the main form but bind it to a field in the recordsource of the subform?[/color]
Maybe[color=blue]
> something like Forms!MyMainForm!MySubformControl!MyField in the control[/color]
source[color=blue]
> property???[/color]

the above field reference will probably work, except you may have to modify
it to
Forms!MyMainForm!MySubformControl.Form!MyField
fyi, if you go the "control on subform" route, you shouldn't need a separate
control for each page. in design view, drag the side of the form out away
from the edge of the tab control (this is temporary, just to give you room
to work). add a text box control in that newly opened space in the detail
section. now drag the text box over on to the tab control *without selecting
either the tab control or any specific page*. click thru your tabs and you
should see the new text box showing "thru" on every one. drag the right side
of your form back to its' original position.

hth


"Steve" <spam@nospam.spam> wrote in message
news:hUfoc.6711$KE6.3569@newsread3.news.atl.earthl ink.net...[color=blue]
> John,
>
> Thanks for responding! You misread my post, there's not 15 tab controls;[/color]
there's[color=blue]
> only one with 15 tabs. The table has around 60 fields so each page of the[/color]
tab[color=blue]
> control only has a couple of fields. The design of the tab control takes[/color]
up all[color=blue]
> the area of the primary subform so there's no room to put the one field[/color]
outside[color=blue]
> the tab control.
>
> I am going to look at implementing your suggestion of fifteen controls all[/color]
bound[color=blue]
> to the same field, one on each tab page. Is there any way to put a textbox[/color]
on[color=blue]
> the main form but bind it to a field in the recordsource of the subform?[/color]
Maybe[color=blue]
> something like Forms!MyMainForm!MySubformControl!MyField in the control[/color]
source[color=blue]
> property???
>
> In the way of synchronized subforms, is there a way to make two subforms[/color]
based[color=blue]
> on the same record source always be on the same record, ie, data entry in[/color]
either[color=blue]
> subform will always record data in the same underlying record?
>
> Thanks, John,
>
> Steve
>
>
> "John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
> news:1dv2a0pnsgmkeq3sekcalhsii1c7amacju@4ax.com...[color=green]
> > On Tue, 11 May 2004 21:56:41 GMT, "Steve" <spam@nospam.spam> wrote:
> >[color=darkred]
> > >I have a form, primary subform and secondary subform. A tab control[/color][/color][/color]
takes up[color=blue]
> all[color=green][color=darkred]
> > >the area of the primary subform. There are about 15 tabs on the[/color][/color][/color]
tabcontrol.[color=blue]
> Each[color=green][color=darkred]
> > >tab contains fields from the same table. Related fields appear on each[/color][/color][/color]
tab.[color=blue][color=green]
> >
> > WHOA. How many fields in your table!? FIFTEEN tab controls - you must
> > be pushing the 255 field limit, and (much more insidiously) the 2000
> > characters per record limit. Are you certain that your table is
> > properly normalized?
> >[color=darkred]
> > >There is one field in the table that needs to be displayed at all times[/color][/color][/color]
so I[color=blue][color=green][color=darkred]
> > >created the secondary subform (subform to main form) to display just[/color][/color][/color]
that one[color=blue][color=green]
> >
> > It is not necessary to have a separate subform to do this, and I'd in
> > fact advise against it. It's perfectly possible to put this one field
> > on the Form *NOT* on the tab control; or, if you prefer, you can put
> > fifteen controls all bound to the same field, one on each tab page.
> > Having the same record open simultaneously on two subforms can and
> > will (as you have seen) get you into synchronization trouble!
> >
> > John W. Vinson[MVP]
> > Come for live chats every Tuesday and Thursday
> > http://go.compuserve.com/msdevapps?loc=us&access=public[/color]
>
>[/color]


Steve
Guest
 
Posts: n/a
#5: Nov 12 '05

re: Two Subforms - Same Record


Tina,

Thanks for responding!

That's a great idea for the textbox!!

I haven't been able to get the field reference to work!

Steve


"tina" <nospam@address.com> wrote in message
news:m6joc.45724$Ut1.1298096@bgtnsc05-news.ops.worldnet.att.net...[color=blue]
> Is there any way to put a textbox on[color=green]
> > the main form but bind it to a field in the recordsource of the subform?[/color]
> Maybe[color=green]
> > something like Forms!MyMainForm!MySubformControl!MyField in the control[/color]
> source[color=green]
> > property???[/color]
>
> the above field reference will probably work, except you may have to modify
> it to
> Forms!MyMainForm!MySubformControl.Form!MyField
> fyi, if you go the "control on subform" route, you shouldn't need a separate
> control for each page. in design view, drag the side of the form out away
> from the edge of the tab control (this is temporary, just to give you room
> to work). add a text box control in that newly opened space in the detail
> section. now drag the text box over on to the tab control *without selecting
> either the tab control or any specific page*. click thru your tabs and you
> should see the new text box showing "thru" on every one. drag the right side
> of your form back to its' original position.
>
> hth
>
>
> "Steve" <spam@nospam.spam> wrote in message
> news:hUfoc.6711$KE6.3569@newsread3.news.atl.earthl ink.net...[color=green]
> > John,
> >
> > Thanks for responding! You misread my post, there's not 15 tab controls;[/color]
> there's[color=green]
> > only one with 15 tabs. The table has around 60 fields so each page of the[/color]
> tab[color=green]
> > control only has a couple of fields. The design of the tab control takes[/color]
> up all[color=green]
> > the area of the primary subform so there's no room to put the one field[/color]
> outside[color=green]
> > the tab control.
> >
> > I am going to look at implementing your suggestion of fifteen controls all[/color]
> bound[color=green]
> > to the same field, one on each tab page. Is there any way to put a textbox[/color]
> on[color=green]
> > the main form but bind it to a field in the recordsource of the subform?[/color]
> Maybe[color=green]
> > something like Forms!MyMainForm!MySubformControl!MyField in the control[/color]
> source[color=green]
> > property???
> >
> > In the way of synchronized subforms, is there a way to make two subforms[/color]
> based[color=green]
> > on the same record source always be on the same record, ie, data entry in[/color]
> either[color=green]
> > subform will always record data in the same underlying record?
> >
> > Thanks, John,
> >
> > Steve
> >
> >
> > "John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
> > news:1dv2a0pnsgmkeq3sekcalhsii1c7amacju@4ax.com...[color=darkred]
> > > On Tue, 11 May 2004 21:56:41 GMT, "Steve" <spam@nospam.spam> wrote:
> > >
> > > >I have a form, primary subform and secondary subform. A tab control[/color][/color]
> takes up[color=green]
> > all[color=darkred]
> > > >the area of the primary subform. There are about 15 tabs on the[/color][/color]
> tabcontrol.[color=green]
> > Each[color=darkred]
> > > >tab contains fields from the same table. Related fields appear on each[/color][/color]
> tab.[color=green][color=darkred]
> > >
> > > WHOA. How many fields in your table!? FIFTEEN tab controls - you must
> > > be pushing the 255 field limit, and (much more insidiously) the 2000
> > > characters per record limit. Are you certain that your table is
> > > properly normalized?
> > >
> > > >There is one field in the table that needs to be displayed at all times[/color][/color]
> so I[color=green][color=darkred]
> > > >created the secondary subform (subform to main form) to display just[/color][/color]
> that one[color=green][color=darkred]
> > >
> > > It is not necessary to have a separate subform to do this, and I'd in
> > > fact advise against it. It's perfectly possible to put this one field
> > > on the Form *NOT* on the tab control; or, if you prefer, you can put
> > > fifteen controls all bound to the same field, one on each tab page.
> > > Having the same record open simultaneously on two subforms can and
> > > will (as you have seen) get you into synchronization trouble!
> > >
> > > John W. Vinson[MVP]
> > > Come for live chats every Tuesday and Thursday
> > > http://go.compuserve.com/msdevapps?loc=us&access=public[/color]
> >
> >[/color]
>
>[/color]


John Vinson
Guest
 
Posts: n/a
#6: Nov 12 '05

re: Two Subforms - Same Record


On Wed, 12 May 2004 06:02:58 GMT, "tina" <nospam@address.com> wrote:
[color=blue]
>drag the text box over on to the tab control *without selecting
>either the tab control or any specific page*. click thru your tabs and you
>should see the new text box showing "thru" on every one.[/color]

great idea Tina! Turning what is often seen as a "bug", or at least an
undesirable feature, to good use!


John W. Vinson[MVP]
Come for live chats every Tuesday and Thursday
http://go.compuserve.com/msdevapps?loc=us&access=public
tina
Guest
 
Posts: n/a
#7: Nov 12 '05

re: Two Subforms - Same Record


thank you, John! <humble bow and big smile>
i've often added command buttons that way, such as Close, Quit, maybe
Reports - anything I want to be seen (and have the same use) on more than
one tab. if there are certain tabs I don't want the control seen on, i
hide/show it in the tab control's OnChange event with a Select Case
statement.
i guess once in a great, great while it pays to not know something is a bug!
<g>


"John Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> wrote in message
news:65q4a0dp2h61u2cgd34jvfvgs0rb4o5omj@4ax.com...[color=blue]
> On Wed, 12 May 2004 06:02:58 GMT, "tina" <nospam@address.com> wrote:
>[color=green]
> >drag the text box over on to the tab control *without selecting
> >either the tab control or any specific page*. click thru your tabs and[/color][/color]
you[color=blue][color=green]
> >should see the new text box showing "thru" on every one.[/color]
>
> great idea Tina! Turning what is often seen as a "bug", or at least an
> undesirable feature, to good use!
>
>
> John W. Vinson[MVP]
> Come for live chats every Tuesday and Thursday
> http://go.compuserve.com/msdevapps?loc=us&access=public[/color]


Closed Thread