Re: Tab Form with multiple forms

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Eric,

It would appear that you have a parent->child relationship between Table 1 and your tables on Tabs 2-4, however you have set up your form without this relationship. You need to:
-Make the datasource for the Main form table 1
-Recreate Subform 1 on Tab 1, using the data from the main form's recordsource. You can copy the controls from Subform 1. Now you have created the parent form.
-Get rid of Subform 1 on Tab 1
-Rebind the subforms to the main form, as Alan stated.

That should work!

John

Eric formulated on Thursday :
Perfect! That was great.

Ok now all the records populate from the forms but the Charter ID from the master form is not replicating/coping to the other child tables (Charter ID).

when you look in the child tables, all data is there except the Charter ID.

Is there a way to append or copy the Charter ID from the master form to the other sub forms on the fly, and thus record the Charter ID to the other tables?

Thank so much, I spent hours trying to get that to work and should have asked sooner.
--
Eric the Rookie


"Allen Browne" wrote:

So you have a form with a tab control with 4 pages in it.

The first page is bound to Table1, which has the Charter ID primary key.

The 2nd page contains a subform bound to Table2. With the main form open in design view, right-click the edge of the subform control, and choose Properties. Set:
Link Master Fields Charter ID
Link Child Fields Charter ID
Save the changes. Now this subform will just the records from Table2 that match the record in the main form. When you enter a new record in this subform, Access will automatically assign the Charter ID value to match the value in the main form. You don't need any code or macros.

Repeat that process for the subforms in your other 2 tab pages.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Eric" <Eric@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:7580CF85-1652-445F-8E3F-B9F140B4345E@xxxxxxxxxxxxxxxx
I have 4 forms that have different information, all tied to their
corresponding tables. All 4 tables/forms have a common field (Charter ID).
Table 1 has the Primary key for this field; all others have the same field as
a foreign key not indexed. I have the relationships set to one-to-many from
Table 1.

I'm trying to pre-populate the Charter ID field to the three forms/tables...
from Form 1/table 1. This is to allow the user to start a new record in form
1, and then move through the form tabs 2-4 and the Charter ID is already
filled in and recorded in the tables 2, 3 and 4.

I have tried to use SetValue macros etc. but can't seem to get even close.
I have tried all combinations for on Open, After update, on exit etc. and
can't seem to get it.

I'll try and appreciate any and all ideas.

Form1 Primary Key Form2 Form 3 Form 4
(Charter ID) --> (Charter ID) --> (Charter ID) --> (Charter ID)

Thanks for your time.

--
Eric the Rookie




.



Relevant Pages

  • Re: Form Design - Data Entry
    ... Place the controls from Table1 onto the first page of the tab control. ... There are many ways to make a subform, including using the subform wizard in ... you should see the name of the main form's primary key as the ...
    (microsoft.public.access.forms)
  • Re: Tab Form with multiple forms
    ... Eric the Rookie ... and put it on Tab 2. ... You would then link the [Charter ID] ... You can copy the controls from Subform 1. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Tab Form with multiple forms
    ... master form is not replicating/coping to the other child tables (Charter ID). ... The first page is bound to Table1, which has the Charter ID primary key. ... The 2nd page contains a subform bound to Table2. ... I have the relationships set to one-to-many ...
    (microsoft.public.access.modulesdaovba)
  • Re: Performance question
    ... It only fetches the primary key of the given table and use that set of keys to 'scroll', fetching the complete row just in time. ... As for the idea about tab, note that it does not mean those subform nested in tabs doesn't get loaded only when the tab is selected. ... So a form with 7 subforms on a tab control could have a big initial load time because it has to fetch the keys and few initial records to satisfy the 8 forms in total. ... A common technique for this kind of design is to actually implement only one subform 'above' the tab control and changing the subform's SourceObject property when the tab is changed, thus there's always two form loaded, rather than eight. ...
    (microsoft.public.access.forms)
  • Re: Tab Form with multiple forms
    ... All data from Charters that you need to edit, goes on Tab 1. ... In your Crew table you would have [Charter ID] and. ... You would set this up as a subform, and put it on Tab 2. ... Ok now all the records populate from the forms but the Charter ID from the master form is not replicating/coping to the other child tables. ...
    (microsoft.public.access.modulesdaovba)