Page 1 of 2 12 LastLast
Results 1 to 15 of 24
  1. #1
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50

    Unanswered: Figuring out old code

    Is there a way see where a table field gets its information when a new record is saved?

    Basically, a table field is being tagged w/ the primary key info from another table (these tables are one-to-many), and there is nothing that I can find in the code to tell me how the field in the 'many' table is being populated. I save new records from a form (Recordsource is the 'one side' table) with a subform (Recordsource is the 'many side' table). Any advice on how to backtrack how the field is being populated?

    Thanks,
    Stace.
    Last edited by reoterq; 08-16-04 at 11:32.
    Thanks in advance or hope this helps.

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    View the relationships?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    Let me get this right: If I go to Tools, Relationships, then click on the relationship in question, the listed field in the many side of the table is going to be populated by the data in the listed one field for that record when the record is new and saved or updated in some other way? If this is the case, please confirm, because the field on the many side is NOT getting populated on an update when I use QUERYS based on the tables.

    Thanks again
    Stace
    Last edited by reoterq; 08-16-04 at 12:53.
    Thanks in advance or hope this helps.

  4. #4
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Ok...

    I quite obviously don't understand what your question is then.

    Are you asking what the relationship is between the form and the subform? There is NO quick way to find out where data is "coming from" short of reading the code, by hand, to figure out what it's doing.

    sorry.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  5. #5
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Do you have the referenal (SP) integ on? Teddy I think she sees the new record in the second table. But the master table can't see the new record?

    Is this in the ball park
    Ryan
    My Blog

  6. #6
    Join Date
    Aug 2004
    Posts
    13

    one-to-many relationship

    it sounds like your database is setup with textbook-type relationships. When you design a relational database, you would normally setup your relating fields as an AutoNumber on the one side (primary key) and a regular Number field on the many side. The table on the "One" side stores records such as clients that are, for the most part, relatively static in nature, and never repeated within the table. The Prmary key ensures that each record is uniquely identified. As a result, in your "one" table, Client ID 12345 - Samle Client, would most likely be identified by the Primary Key as simply 5 (or whatever number was automatically assigned during input). In the "many" table, in the field that has been identified as part of the "Relationship", the corresponding record will contain the same value found in the Primary Key of the "one" table. This is how Access "links" the two tables to form the relationship.
    Depending on which version you are using, Access should display these related records via + in the "one" table. Just open the "one"-side table and expand the + next to one of your records to display the relating record from the "many" table

    Sorry for the confusion, relationships can be quite complex. If you would like to discuss this outside the forum e-mail me at

    Dale <dot> Evanchak "at" Ceridian <dot> com

  7. #7
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    Quote Originally Posted by rguy84
    Do you have the referenal (SP) integ on? Teddy I think she sees the new record in the second table. But the master table can't see the new record?

    Is this in the ball park

    Very close to being in the ballpark. If the form updates the tables directly, the referential field is populated in the "many" table. If the form updates through querys, the referential field is not populated, and therefore cannot be associated with its respective record in the master table.
    Thanks in advance or hope this helps.

  8. #8
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    Quote Originally Posted by reoterq
    Very close to being in the ballpark. If the form updates the tables directly, the referential field is populated in the "many" table. If the form updates through querys, the referential field is not populated, and therefore cannot be associated with its respective record in the master table.

    Why doesn't the referential field get populated through a query?
    Thanks in advance or hope this helps.

  9. #9
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What's the query?
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  10. #10
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    In your relationships window dbl click the line connecting the tables. The edit relationships window will come up. Click the Enforce integ checkbox. and then the other two...
    Ryan
    My Blog

  11. #11
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    Can't. the subdatasheet name is set to [auto]. The blank field violates referertial integrity rules.
    Thanks in advance or hope this helps.

  12. #12
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    Set to auto? The blannk field violates? uh....do you have a validation rule, don't allow nulls, or is the field/PK you are relating null? I have made tables with 10 fields and 2 in each wer only filled. It worked fine...
    Ryan
    My Blog

  13. #13
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    Quote Originally Posted by rguy84
    In your relationships window dbl click the line connecting the tables. The edit relationships window will come up. Click the Enforce integ checkbox. and then the other two...

    OK, you were right - I had some orphaned child table records. I now have referential integrity and the other two boxes checked . . . but I still haven't resolved the problem, which is:

    Quote Originally Posted by reoterq
    Very close to being in the ballpark. If the form updates the tables directly, the referential field is populated in the "many" table. If the form updates through querys, the referential field is not populated, and therefore cannot be associated with its respective record in the master table.
    Thanks in advance or hope this helps.

  14. #14
    Join Date
    Jun 2004
    Location
    Seattle, WA
    Posts
    601
    I am assuming that you checked the mast table and things are matched up. But when you put a new record it it doesn't line up correctly?

    I am assuming when you enter data, you use the master table and when you need to put the secondary stuff in (table 2) you just click the little + on the front of the record. If this is the case on your form your PK isn't looking at the right spot, and doesn't know how to update.
    Ryan
    My Blog

  15. #15
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    50
    Quote Originally Posted by rguy84
    I am assuming that you checked the mast table and things are matched up. But when you put a new record it it doesn't line up correctly?
    Using a form and subform, I look at my data. The form uses a query based on the master table so that I can focus in on specific data. The subform also uses a query, which is based on the child table. When I want to add a new subform record, the child field is not populated with the master field referential data.

    Quote Originally Posted by rguy84
    I am assuming when you enter data, you use the master table and when you need to put the secondary stuff in (table 2) you just click the little + on the front of the record. If this is the case on your form your PK isn't looking at the right spot, and doesn't know how to update.
    No to the data entry assumption. However, the PK statement sounds like it might have some merit. Let's start there . . . what's PK?
    Thanks in advance or hope this helps.

Posting Permissions

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