A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Two Subforms - Same Record



 
 
Thread Tools Display Modes
  #1  
Old May 11th, 2004, 10:56 PM
Steve
external usenet poster
 
Posts: n/a
Default Two Subforms - Same Record

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


  #2  
Old May 12th, 2004, 02:31 AM
John Vinson
external usenet poster
 
Posts: n/a
Default Two Subforms - Same Record

On Tue, 11 May 2004 21:56:41 GMT, "Steve" 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
  #3  
Old May 12th, 2004, 03:23 AM
Steve
external usenet poster
 
Posts: n/a
Default 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" wrote in message
...
On Tue, 11 May 2004 21:56:41 GMT, "Steve" 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



  #4  
Old May 12th, 2004, 07:02 AM
tina
external usenet poster
 
Posts: n/a
Default Two Subforms - Same Record

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" wrote in message
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" wrote in message
...
On Tue, 11 May 2004 21:56:41 GMT, "Steve" 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





  #5  
Old May 12th, 2004, 03:32 PM
Steve
external usenet poster
 
Posts: n/a
Default 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" wrote in message
...
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" wrote in message
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" wrote in message
...
On Tue, 11 May 2004 21:56:41 GMT, "Steve" 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







  #6  
Old May 12th, 2004, 06:07 PM
dandgard
external usenet poster
 
Posts: n/a
Default Two Subforms - Same Record


If you had designed your tab control correctly you could have the one
field that needs to be on all tabs show up on all tabs and then design
the other fields around the placement of that field. Try this, create
a field and then drag and drop it onto the tab control. It will show
up on top for all tab indices. IF you place it properly I am sure you
can work the other fields on each individual tab around it.

You should not have two subforms to the same form that open the same
record.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

  #7  
Old May 12th, 2004, 07:11 PM
John Vinson
external usenet poster
 
Posts: n/a
Default Two Subforms - Same Record

On Wed, 12 May 2004 06:02:58 GMT, "tina" 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
  #8  
Old May 12th, 2004, 07:36 PM
tina
external usenet poster
 
Posts: n/a
Default 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" wrote in message
...
On Wed, 12 May 2004 06:02:58 GMT, "tina" 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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.