By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,312 Members | 2,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,312 IT Pros & Developers. It's quick & easy.

Two Subforms - Same Record

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
On Tue, 11 May 2004 21:56:41 GMT, "Steve" <sp**@nospam.spam> wrote:
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.
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 so I
created the secondary subform (subform to main form) to display just that one


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
Nov 12 '05 #2

P: n/a
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:1d********************************@4ax.com...
On Tue, 11 May 2004 21:56:41 GMT, "Steve" <sp**@nospam.spam> wrote:
I have a form, primary subform and secondary subform. A tab control takes up allthe area of the primary subform. There are about 15 tabs on the tabcontrol. Eachtab contains fields from the same table. Related fields appear on each tab.


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 so I
created the secondary subform (subform to main form) to display just that one


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

Nov 12 '05 #3

P: n/a
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???
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" <sp**@nospam.spam> wrote in message
news:hU*****************@newsread3.news.atl.earthl ink.net... 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:1d********************************@4ax.com...
On Tue, 11 May 2004 21:56:41 GMT, "Steve" <sp**@nospam.spam> wrote:
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.
Eachtab contains fields from the same table. Related fields appear on each
tab.
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
so Icreated the secondary subform (subform to main form) to display just

that one
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


Nov 12 '05 #4

P: n/a
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" <no****@address.com> wrote in message
news:m6*********************@bgtnsc05-news.ops.worldnet.att.net...
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???


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" <sp**@nospam.spam> wrote in message
news:hU*****************@newsread3.news.atl.earthl ink.net...
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:1d********************************@4ax.com...
On Tue, 11 May 2004 21:56:41 GMT, "Steve" <sp**@nospam.spam> wrote:

>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.
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 so I >created the secondary subform (subform to main form) to display just that one
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



Nov 12 '05 #5

P: n/a
On Wed, 12 May 2004 06:02:58 GMT, "tina" <no****@address.com> wrote:
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.


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
Nov 12 '05 #6

P: n/a
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:65********************************@4ax.com...
On Wed, 12 May 2004 06:02:58 GMT, "tina" <no****@address.com> wrote:
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 youshould see the new text box showing "thru" on every one.


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

Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.