Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2003
    Location
    China
    Posts
    54

    Unanswered: Losing linking data when using a tabs control

    Losing a lot of data... suggestions would be greatly appreciated.

    I have inserted a tabs control in my form. The 1st tab contains controls linked to my main table as a data source. The 2nd tab contains controls (or sub-forms) linked to sub-tables as their data source.

    In the 2nd tab, I have two sub-forms (one within the other) such that my form's tab arrangement then looks like this:

    -----------------------------------------------------------------------
    Main table
    -----------------------------------------------------------------------
    1st tab 2nd tab
    -----------------------------------------------------------------------
    - All controls link to - All controls are within a
    main table sub-form (some controls link
    directly to the table related to
    this sub-form)
    - Another sub-form (within the
    above sub-form) contain the
    remaining controls (linked to
    the 3rd level sub-table)
    -----------------------------------------------------------------------

    I am finding (at all sub-levels) that the linking data is being lost in many occasions (more than half the time). Why is this? I don't want to have to add a "save" button to all my forms to ensure the information is refreshed before the forms are closed.

    Please help.

    Richard A.

  2. #2
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67

    Re: Losing linking data when using a tabs control

    Originally posted by Trumpet
    Losing a lot of data... suggestions would be greatly appreciated.

    I have inserted a tabs control in my form. The 1st tab contains controls linked to my main table as a data source. The 2nd tab contains controls (or sub-forms) linked to sub-tables as their data source.

    In the 2nd tab, I have two sub-forms (one within the other) such that my form's tab arrangement then looks like this:

    -----------------------------------------------------------------------
    Main table
    -----------------------------------------------------------------------
    1st tab 2nd tab
    -----------------------------------------------------------------------
    - All controls link to - All controls are within a
    main table sub-form (some controls link
    directly to the table related to
    this sub-form)
    - Another sub-form (within the
    above sub-form) contain the
    remaining controls (linked to
    the 3rd level sub-table)
    -----------------------------------------------------------------------

    I am finding (at all sub-levels) that the linking data is being lost in many occasions (more than half the time). Why is this? I don't want to have to add a "save" button to all my forms to ensure the information is refreshed before the forms are closed.

    Please help.

    Richard A.
    I doubt that it is the tab control that is causing the problem. What you are describing is not extraordinary.

    Are you sure that the data is not being saved in the tables? It would make more sense if the data just was not visible in the form/subforms after entering it. That would probably be a parent/child relating problem.

    Enter a record, close the form, and look in the linked tables for the data.

  3. #3
    Join Date
    Apr 2003
    Location
    China
    Posts
    54
    Sorry to get back to you so late...

    I have tried what you said, and all the data entered seems to be in the tables, just not the linking data (ie. the number that identifies the record of the parent form to link with). I must stress that this only happens on some occasions - it doesn't happen for me... just some of the other users.

    I tried compacting and repairing the database - could it just be a quirk?

    Greatly appreciate your suggestions.

    Richard.

  4. #4
    Join Date
    Apr 2003
    Location
    China
    Posts
    54
    I think I have figured it out!

    The other users must be creating a new record and, without entering any information in the main tab (with the controls linked to the parent table), enter information in the sub-forms.

    I tested this and found that if I enter sub-form info first, then tab back to the main tab page (with controls linked to parent table) the child tables don't store a figure for linking to the parent table. Then if I click back to the other tab (with controls linking to the child-table) it can't find the record. Going back to the child table I can find the record, but without the linking data.

    Will try to create a macro to check that the linking info is stored in the record before allowing data entry (and conduct some user training).

    Cheers for your help.

    Richard.

  5. #5
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67
    Originally posted by Trumpet
    Sorry to get back to you so late...

    I have tried what you said, and all the data entered seems to be in the tables, just not the linking data (ie. the number that identifies the record of the parent form to link with). I must stress that this only happens on some occasions - it doesn't happen for me... just some of the other users.

    I tried compacting and repairing the database - could it just be a quirk?

    Greatly appreciate your suggestions.

    Richard.
    Quirks doen't reoccur.

    So the data is being saved. Its just that the binding ID is not passing from the parent table to the child table via the subform?

    You may want to try this as an alternative method. I am assuming that the subforms are 1:many associations. If they are a 1:1 relationship you can write a query for all the fields need. This view/query acts just like a table within access. But all tables have to have a 1:1 relationship.

    Suggestion: Link the primary table to the main form, probable just copy the form as you have it. Create a subform with the associated link without the sub/subform. Create the third subform separately and place it on the form not the subform.

    Everything will be the same for the Form and 1st subform. The second subform for the Link Master Fields property you need to use the full object name.

    Forms!myForm!MySubform.Form!MySubFormID

  6. #6
    Join Date
    Apr 2003
    Location
    Santa Barbara, CA
    Posts
    67
    Originally posted by Trumpet
    I think I have figured it out!

    The other users must be creating a new record and, without entering any information in the main tab (with the controls linked to the parent table), enter information in the sub-forms.

    I tested this and found that if I enter sub-form info first, then tab back to the main tab page (with controls linked to parent table) the child tables don't store a figure for linking to the parent table. Then if I click back to the other tab (with controls linking to the child-table) it can't find the record. Going back to the child table I can find the record, but without the linking data.

    Will try to create a macro to check that the linking info is stored in the record before allowing data entry (and conduct some user training).

    Cheers for your help.

    Richard.
    Good Job.

    An easy way to insure the presents of a new record is to code data into the new record when the new record is initiated. A default value, a prompt, etc. This will pop an autonumber for the record which will cascade to the subforms automatically when data is entered into the subforms.

  7. #7
    Join Date
    Apr 2003
    Location
    China
    Posts
    54
    Thanks for your help Robt917,

    I have a few options to work with now... looks like it's under control.

    Cheers,

    Richard.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •