Results 1 to 5 of 5
  1. #1
    Hannu is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2008
    Location
    Sydney, Australia
    Posts
    11

    Automatically fill in value from another table

    I have two tables in the same database. each table has a field called ID which is also the primary key. one table is person's private details and the other business details, they are linked together with a relationship.
    I want to automatically fill in the business details table ID when I enter data into the private details table, ID field.
    This assist me in looking at the Form which display fields from both tables. So when I fill in the ID field in the private table (or that part of the Form) the ID filed in the business details will automatically fill in.



    Thanks for looking into this

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    What is the relationship of these tables? one-to-one or one-to-many or many-to-many? Answer these questions:

    Can person have many business?

    Can business have many persons?

    Will every person have a business?

    If you want a business record to automatically have the ID of the person record, the ID field in business must be a number (not Autonumber) field. Assuming you do have relationship set in Relationship builder:

    1. if you do entry in tables, open persons table, click on the + sign at left of record, enter record into business table. The ID will automatically populate

    2. if you do entry in forms, use form/subform arrangement

    If these tables are a one-to-one relationship, could be one table.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Hannu is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2008
    Location
    Sydney, Australia
    Posts
    11
    Quote Originally Posted by June7 View Post
    What is the relationship of these tables? one-to-one or one-to-many or many-to-many? Answer these questions: relationship is one-to-one

    Can person have many business? Good point but not in this case

    Can business have many persons? not in this case. each person has a separate business information, this is like an address book where each person has business contact details, so it does not matter if there is another person in the same business.

    Will every person have a business? no

    If you want a business record to automatically have the ID of the person record, the ID field in business must be a number (not Autonumber) field. Assuming you do have relationship set in Relationship builder:I use a number for the person's ID, not autonumber.

    1. if you do entry in tables, open persons table, click on the + sign at left of record, enter record into business table. The ID will automatically populate. good, this gets me a step towards the solution.

    2. if you do entry in forms, use form/subform arrangement. Yes, I use a form to enter details and the aim is to populate the ID of business table when personal table is completed.

    If these tables are a one-to-one relationship, could be one table.
    Thanks for the help June7, so how do i populate the business ID when filling personal ID details using a Form?
    I should tell you that this is an activity for my students so although it should reflect real workplace system it does not have to be perfect. the main objective is to learn to make simple tables, Forms, relationships and Reports.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Use form/subform arrangement. Set the Master/Child link properties of the subform container control to synchronize the related records and automatically populate the business ID field when a value is entered in any other field of business record.

    This is basic Access functionality and Access Help has guidelines on building tables, queries, forms, reports. What kind of class would you teach and not be familiar with these basics? I am sure there are many elementary tutorials available on the web and in reference books.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Hannu is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2008
    Location
    Sydney, Australia
    Posts
    11
    Thank you for your help June7, I'll work on that advise, I have set the forms as form/subform, just needed the auto-populate function to "decorate" the database. What comes to the basic level, this course is VERY basic, students are required to operate a database and create simple tables etc, the students have never used Access before and have 2 day introduction. What comes to you suggestion of my skills and knowledge, unfortunately Access has never been my favourite software, hence lack of skills and knowledge so I rely of experts as yourself which I greatly appreciate, my expertise is elsewhere. What is "basic" to one person may not be so basic to another. My skills, although "light" are enough.
    Thank you again for your help.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Fill in blanks from another table
    By HectorH in forum Queries
    Replies: 1
    Last Post: 08-26-2011, 05:13 PM
  2. Replies: 7
    Last Post: 06-14-2011, 10:37 AM
  3. Fill table with query?
    By brc in forum Reports
    Replies: 0
    Last Post: 03-15-2011, 02:54 AM
  4. Replies: 2
    Last Post: 09-20-2010, 09:02 PM
  5. Auto fill a table?
    By newtoAccess in forum Access
    Replies: 3
    Last Post: 11-21-2009, 08:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums